Свойства текста
.pdf
Пример:
body |
{line-height: 14px; font-size: 13px;} |
p.cl1 |
{line-height: 1.5em;} |
p.cl2 |
{font-size: 10px; line-height: 150%;} |
p.cl3 |
{line-height: 0.33in;} |
<p>This paragraph inherits a 'line height' of
14px from the body, as well as a 'font size' of 13px.</p>
<p class="cl1">This paragraph has a 'line height' of 19,5px(13 * 1.5), so it will have slightly more line height than usual.</p>
<p class="cl2">This paragraph has a 'line height' of 15px (10 * 150%), so it will have slightly more line height than usual.</p>
<p class="cl3">This paragraph has a 'line height' of 0.33in, so it will have slightly more line height than usual.</p>
Вертикальное выравнивание
{vertical-align: … }
В CSS свойство vertical-align применяется только к строковым и замещаемым элементам, таким как изображения и поля ввода формы. Свойство не является наследуемым.
Пример 1:
img {vertical-align: baseline;}
p {text-align: left;}
Согласно этому правилу текст выравнивается по левому краю это характерно для западных языков которые читаются слева на право.
p {text-align: right;}
Для языков Иврит и Арабский по умолчанию задается занчение выравнивания «right» поскольку текст читается справа налево.
Расстояния между словами
{ word-spacing: … }
Пример:
p.spread |
{word-spacing: |
0.5em;} |
|
p.tight |
{word spacing: |
-0.5em;} |
|
p.base |
{word |
spacing: |
normal;} |
p.norm |
{word |
spacing: |
0;} |
Расстояние между буквами
{letter-spacing: ...}
p {letter spacing: 0;} /* идентично 'normal' */ p.spacious {letter spacing: 0.25em;}
p.tight {letter spacing: 0.25em;}
Преобразование текста
{text-transform: ...}
h1 {texttransform: capitalize;} strong {texttransform: uppercase;}
p.cummings {texttransform: lowercase;} p.raw {texttransform: none;}
Оформление текста
{text-decoration … }
p.emph {text decoration: underline;} p.topper{text decoration: overline;}
p.old {text decoration: line through;} p.annoy {text decoration: blink;}
p.plain {text decoration: none;}
Затенение текста text-shadow { … }
p.cl1 {color: black; text-shadow: silver 2px
2px 2px;}
p.cl2 {color: white; text-shadow: 0 0 4px black;}
p.cl3 {color: black; text-shadow: -1em -1em
5px gray, 1em 1em silver;}
Задание !
