font-style

將物件的字型樣式設為斜體、一般或傾斜。

語法

{ font-style: sStyle }

可能的值

sStyle

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

normal

預設值。使用一般字型。

italic

字型為斜體。

oblique

字型為傾斜。如果字型沒有傾斜形式,則會以斜體呈現。

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

範例

下列範例顯示如何使用 H3 元素作為選取器,將 H3 標題的字型樣式設為 italic

<style>
    h3 {font-style:italic}
</style>

標準資訊

您可以在 Cascading Style Sheets (CSS), Level 1 (CSS1) (階層式樣式表 (CSS) 層級 1 (CSS1)) Ee371225.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