Skip to content

Instantly share code, notes, and snippets.

@anselmh
Created February 9, 2013 11:32
Show Gist options
  • Save anselmh/4744956 to your computer and use it in GitHub Desktop.
Save anselmh/4744956 to your computer and use it in GitHub Desktop.
Untitled
.overflowed > p{
width: 10em;
height: 5em;
white-space: nowrap;
overflow: hidden;
}
.overflowed-clip {
text-overflow: clip;
}
.overflowed-ellipsis > p {
text-overflow: ellipsis;
}
.overflowed-ellipsis-word > p {
text-overflow: ellipsis-word;
}
<!-- example showing text-overflow shorthand property -->
<div class="overflowed overflowed-clip"><p>This is an example text showing nothing interesting but the truncated content via text-overflow shorthand property.</p></div>
<div class="overflowed overflowed-ellipsis"><p>This is an example text showing nothing interesting but the truncated content via text-overflow shorthand property.</p></div>
<div class="overflowed overflowed-ellipsis-word"><p>This is an example text showing nothing interesting but the truncated content via text-overflow shorthand property.</p></div>
// alert('Hello world!');
{"view":"split","fontsize":"100","seethrough":"","prefixfree":"1","page":"all"}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment