スタイルfontVariantプロパティ
例
要素のフォントを「スモールキャップス」に設定します。
document.getElementById("demo").style.fontVariant = "small-caps";
定義と使用法
fontVariantプロパティは、フォントを小文字で表示するかどうかを設定または返します。
これは、すべての小文字が大文字に変換されることを意味しますが、文字のフォントサイズは残りのテキストに比べて小さくなります。
ブラウザのサポート
Property | |||||
---|---|---|---|---|---|
fontVariant | Yes | Yes | Yes | Yes | Yes |
構文
fontVariantプロパティを返します。
object.style.fontVariant
fontVariantプロパティを設定します。
object.style.fontVariant = "normal|small-caps|initial|inherit"
プロパティ値
Value | Description |
---|---|
normal | The font is normal. This is default |
small-caps | The font is displayed in small capital letters |
initial | Sets this property to its default value. Read about initial |
inherit | Inherits this property from its parent element. Read about inherit |
技術的な詳細
デフォルト値: | 正常 |
---|---|
戻り値: | 通常の大文字または小文字の大文字でフォントを表す文字列 |
CSSバージョン | CSS1 |
その他の例
例
要素のフォントバリアントを返します。
alert(document.getElementById("demo").style.fontVariant);
関連ページ
CSSチュートリアル:CSSフォント
CSSリファレンス:font-variantプロパティ
HTML DOMリファレンス:フォントプロパティ
❮スタイルオブジェクト