Blocks justify
Last active
August 29, 2015 14:13
-
-
Save selahssea-zz/4f17d0f6ea8e3202a6b1 to your computer and use it in GitHub Desktop.
Выравнивание блоков по ширине
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
<ul> | |
<li>1</li> | |
<li>2</li> | |
<li>3</li> | |
<li>4</li> | |
<li>5</li> | |
</ul> |
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
ul { | |
font: 14px Verdana, Geneva, sans-serif; | |
text-align: justify; | |
margin: 0; | |
padding: 0; | |
/* Обнуляем для родителя*/ | |
line-height: 0; | |
font-size: 1px; /* 1px для Opera */ | |
/* Лекарство для IE6-7*/ | |
text-justify: newspaper; | |
zoom:1; | |
/* Включаем в работу последнюю строку*/ | |
text-align-last: justify; | |
} | |
ul:after { | |
width: 100%; | |
height: 0px; | |
visibility: hidden; | |
overflow: hidden; | |
content: ''; | |
display: inline-block; | |
} | |
ul li { | |
background: #E76D13; | |
width: 98px; | |
height: 98px; | |
display: inline-block; | |
text-align: left; | |
border: 1px solid #000; | |
/* Востанавливаем у потомков, кроме последнего*/ | |
line-height: normal; | |
font-size: 14px; | |
/* Без него в Opera будет отступ под элементами */ | |
vertical-align: top; | |
/* эмуляция inline-block для IE6-7*/ | |
//display : inline; | |
//zoom : 1; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment