Last active
December 12, 2023 20:33
-
-
Save Polkovn1k/7b4204ef284bb5ca8f771639829cc9f4 to your computer and use it in GitHub Desktop.
ellipsis (...) by css (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
//Многострочный текст. Нельзя задавать padding элементу, иначе работать будет криво | |
.someSelector { | |
overflow : hidden; | |
text-overflow: ellipsis; | |
display: -webkit-box; | |
-webkit-line-clamp: 2; | |
-webkit-box-orient: vertical; | |
} | |
//Однострочный текст | |
.someSelector { | |
text-overflow: ellipsis; | |
white-space: nowrap; | |
overflow: hidden; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment