Created
November 16, 2021 10:25
-
-
Save skipper999-ops/5ab0c5ff5634c19377823ac150dc1362 to your computer and use it in GitHub Desktop.
CSS line clamps
This file contains 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
.clamp1 { | |
white-space: nowrap; | |
overflow: hidden; | |
text-overflow: ellipsis; | |
} | |
.clamp2 { | |
overflow: hidden; | |
text-overflow: ellipsis; | |
display: -webkit-box; | |
-webkit-line-clamp: 2; | |
-webkit-box-orient: vertical; | |
} | |
.clamp3 { | |
line-height: 20px; | |
overflow: hidden; | |
text-overflow: ellipsis; | |
display: -webkit-box; | |
-webkit-line-clamp: 3; | |
-webkit-box-orient: vertical; | |
} | |
.clamp4 { | |
line-height: 25px; | |
overflow: hidden; | |
text-overflow: ellipsis; | |
display: -webkit-box; | |
-webkit-line-clamp: 4; | |
-webkit-box-orient: vertical; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment