Last active
November 13, 2016 12:15
-
-
Save AnthonyDS/6d1e4f8a0c3094b441a5abc920252d4e to your computer and use it in GitHub Desktop.
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
Однострочное обрезание текста: | |
text-overflow: ellipsis | |
overflow: hidden | |
width: 100px | |
white-space: nowrap | |
Как реализовано многострочное обрезание текста на youtube: | |
1) CSS3 Обрезание текста с троеточием в конце второй строки | |
display: -moz-box | |
display: -webkit-box | |
display: box | |
-webkit-line-clamp: 2 /* WARNING! Поддержка только в: Chrome, Safari, Opera */ | |
-moz-box-orient: vertical; | |
-webkit-box-orient: vertical; | |
box-orient: vertical; | |
text-overflow: ellipsis | |
overflow: hidden | |
max-height: 34px | |
font-size: 16px | |
2) CSS2 Обрезание текста без троеточия | |
line-height: 1.2 | |
max-height: 2.4em | |
font-size: 14px | |
overflow: hidden |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment