font-variant

設定是否使物件的文字成為小型大寫字母。

語法

{ font-variant: sVariant }

可能的值

sVariant

指定或接收下列其中一個值的字串:

normal

預設值。使用一般字型。

small-caps

使字型成為小型大寫字母。

此屬性的預設值為 normal 。這是繼承屬性。

範例

下列範例使用 font-variant 屬性將字型變更為小型大寫字。此範例在內嵌樣式表中使用 P 元素當作選取器,以將所有段落中的字型樣式設為 small-caps

<p style="font-variant:small-caps">

此範例使用內嵌指令碼以在發生 onmousedown 事件時,將字型樣式設為 small-caps

<div onmousedown="this.style.font-variant='small-caps'">

標準資訊

您可以在 Cascading Style Sheets (CSS), Level 1 (CSS1) (階層式樣式表 (CSS) 層級 1 (CSS1)) Ee371242.xtlink_newWindow(zh-tw,Expression.40).png 找到此屬性的定義。

適用範圍

a, abbr, acronym, b, bdo, big, blockquote, body, button, caption, center, cite, code, custom, dd, defaults, del, dfn, div, dl, dt, em, embed, fieldset, font, form, frameset, frame, hn, i, iframe, img, input type=button, input type=checkbox, input type=file, input type=image, input type=password, input type=radio, input type=reset, input type=submit, input type=text, ins, li, object, ol, p, q, s, span, sub, table, td, th, tt, u, ul, var, xmp

另請參閱

概念

font