Created
April 22, 2021 12:29
-
-
Save elshanx/17a6e7c23dbf942de5d07cdde189b545 to your computer and use it in GitHub Desktop.
line clamp css
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
display: -webkit-box; | |
-webkit-line-clamp: 2; // amount of lines u want | |
-webkit-box-orient: vertical; | |
overflow: hidden; | |
/* without clamp, good to know asked in interviews */ | |
text-overflow: ellipsis; | |
overflow: hidden; | |
white-space: nowrap; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment