// Truncate text when it exceeds 3 lines of text using -webkit-line-clamp
p {
overflow: hidden;
display: -webkit-box;
-webkit-box-orient: vertical;
-webkit-line-clamp: 3 // change 3 with any number of lines you want to set
}
.wrapper {
padding: 20px;
background: #eaeaea;
max-width: 400px;
margin: 50px auto;
}
.demo-1 {
overflow: hidden;
display: -webkit-box;
-webkit-line-clamp: 2;
-webkit-box-orient: vertical;
}
.demo-2 {
overflow: hidden;
white-space: nowrap;
text-overflow: ellipsis;
max-width: 150px;
}
.wrapper {
padding: 20px;
background: #eaeaea;
max-width: 400px;
margin: 50px auto;
}
.demo-1 {
overflow: hidden;
display: -webkit-box;
-webkit-line-clamp: 1;
-webkit-box-orient: vertical;
}
.demo-2 {
overflow: hidden;
white-space: nowrap;
text-overflow: ellipsis;
max-width: 150px;
}
Code Example |
---|
Css :: scss light color |
Css :: restrict flex items in a row |
Css :: disable cursor css |
Css :: backdrop filter property for safari not working |
Css :: sm size website |
Css :: css background full screen |
Css :: decrease space between paragraphs html |
Css :: restful url to update status |
Css :: css fill div with background image |
Css :: font awesome pseudo element |
Css :: bash access array indirectly |
Css :: space between li css |
Css :: hr tag customize using css |
Css :: center text in div |
Css :: roboto google apis |
Css :: how to add inline class to a paragraph in css |
Css :: css cut text of |
Css :: css parallelogram |
Css :: remove border radius select css |
Css :: before content from attribute |
Css :: loops scss |
Css :: center div scss |
Css :: change bootstrap input focus glow |
Css :: make element float on top |
Css :: add white background to svg |
Css :: html how to indent text |
Css :: react html height 100% |
Css :: bash list all npm processes |
Css :: text shadow neon |
Css :: button edges rounded css |