CSS font-stretch Property
Przykład
Poszerz tekst w elementach <div>:
div
{
font-family: sans-serif, "Helvetica Neue", "Lucida Grande", Arial;
font-stretch: expanded;
}
Definicja i użycie
Właściwość font-stretch
pozwala na zwężenie tekstu (skondensowanie) lub poszerzenie (rozwinięcie).
Uwaga: Niektóre czcionki mają dodatkowe twarze; skondensowane twarze i rozszerzone twarze. W przypadku tych czcionek można użyć tej font-stretch
właściwości, aby wybrać normalną, skondensowaną lub rozszerzoną czcionkę.
Uwaga: Ta właściwość nie działa, jeśli wybrana czcionka nie oferuje skondensowanych lub rozszerzonych twarzy!
Domyślna wartość: | normalna |
---|---|
Dziedziczny: | tak |
Animowalny: | tak. Przeczytaj o animacji |
Wersja: | CSS3 |
Składnia JavaScript: | obiekt .style.fontStretch="rozszerzony" |
Obsługa przeglądarki
Liczby w tabeli określają pierwszą wersję przeglądarki, która w pełni obsługuje tę właściwość.
Property | |||||
---|---|---|---|---|---|
font-stretch | 48.0 | 9.0 | 9.0 | 11.0 | 35.0 |
Składnia
font-stretch: ultra-condensed|extra-condensed|condensed|semi-condensed|normal|semi-expanded|expanded|extra-expanded|ultra-expanded|initial|inherit;
Wartości nieruchomości
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 |