Свойство CSS font-stretch
Пример
Сделайте текст в элементах <div> шире:
div
{
font-family: sans-serif, "Helvetica Neue", "Lucida Grande", Arial;
font-stretch: expanded;
}
Определение и использование
Свойство font-stretch
позволяет сделать текст более узким (сжатым) или более широким (расширенным).
Примечание. В некоторых шрифтах предусмотрены дополнительные начертания; сжатые грани и расширенные грани. Для этих шрифтов вы можете использовать это font-stretch
свойство для выбора обычного, сжатого или расширенного шрифта.
Примечание. Это свойство не действует, если выбранный шрифт не предлагает сжатые или расширенные начертания!
Значение по умолчанию: | нормальный |
---|---|
Унаследовано: | да |
Анимация: | да. Читать об анимации |
Версия: | CSS3 |
Синтаксис JavaScript: | объект .style.fontStretch="расширенный" |
Поддержка браузера
Цифры в таблице указывают на первую версию браузера, которая полностью поддерживает это свойство.
Property | |||||
---|---|---|---|---|---|
font-stretch | 48.0 | 9.0 | 9.0 | 11.0 | 35.0 |
Синтаксис
font-stretch: ultra-condensed|extra-condensed|condensed|semi-condensed|normal|semi-expanded|expanded|extra-expanded|ultra-expanded|initial|inherit;
Значения свойств
Value | Description |
---|---|
ultra-condensed | Makes the text as narrow as it gets |
extra-condensed | Makes the text narrower than condensed, but not as narrow as ultra-condensed |
condensed | Makes the text narrower than semi-condensed, but not as narrow as extra-condensed |
semi-condensed | Makes the text narrower than normal, but not as narrow as condensed |
normal | Default value. No font stretching |
semi-expanded | Makes the text wider than normal, but not as wide as expanded |
expanded | Makes the text wider than semi-expanded, but not as wide as extra-expanded |
extra-expanded | Makes the text wider than expanded, but not as wide as ultra-expanded |
ultra-expanded | Makes the text as wide as it gets |
initial | Sets this property to its default value. Read about initial |
inherit | Inherits this property from its parent element. Read about inherit |