Last active
August 29, 2015 14:07
-
-
Save jmwhittaker/5dc0a431b464b0cdf490 to your computer and use it in GitHub Desktop.
A response to https://gist.github.com/phuu/cd24356bb7ec54a8ec1a
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
.container { | |
font-family: helvetica, sans-serif; | |
padding-right:30px; /* Same padding as the img required */ | |
} | |
.item { | |
display: inline-block; | |
text-align:left; | |
padding-right:30px; /* Same padding as the img required */ | |
background:url( "http://www.lorempixel.com/30/30") no-repeat center right; /* set img as background & position */ | |
} | |
/* Or you could use :before for the same effect */ | |
/* | |
.item:before { | |
position: absolute; | |
right: 0; | |
content:' '; | |
width:30px; | |
height:30px; | |
background-color:red; | |
} | |
*/ | |
.ellipsis { | |
max-width: 100%; | |
vertical-align: bottom; | |
overflow: hidden; | |
white-space: nowrap; | |
word-wrap: normal; | |
-ms-text-overflow: ellipsis; | |
-o-text-overflow: ellipsis; | |
text-overflow: ellipsis; | |
} | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<div class="outer"> | |
<div class="container"> | |
<div class="item ellipsis">A really long long long long long long long long piece of text</div> | |
</div> | |
</div> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment