Skip to content

Instantly share code, notes, and snippets.

@MOxFIVE
Created April 23, 2016 06:49
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save MOxFIVE/2c20e952d8fcc5da88d51a95c49d4d5c to your computer and use it in GitHub Desktop.
Save MOxFIVE/2c20e952d8fcc5da88d51a95c49d4d5c to your computer and use it in GitHub Desktop.
text-overflow: ellipsis
<span>CSS is awesome, especially when you can scroll
to see extra text instead of just
having it overlap other text by default.</span>
<p>CSS is awesome, especially when you can scroll
to see extra text instead of just
having it overlap other text by default.</p>
span {
display: inline-block;
max-width: 14em;
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
}
p {
display: -webkit-box;
-webkit-line-clamp: 3;
-webkit-box-orient: vertical;
text-overflow: ellipsis;
overflow : hidden;
max-width: 15em;
line-height: 1.5;
}
span, p {
border: 1px solid black;
padding: .5em;
font-family: "Lucida Grande", Verdana, "Helvetica Neue", Arial;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment