中文字幕一区二区人妻电影,亚洲av无码一区二区乱子伦as ,亚洲精品无码永久在线观看,亚洲成aⅴ人片久青草影院按摩,亚洲黑人巨大videos

Style fontVariant 屬性

Style 對象參考手冊 Style 對象

定義和用法

fontVariant 屬性設(shè)置或返回是否以小型大寫字母顯示字體。

這意味著所有的小寫字母將被轉(zhuǎn)換為大寫,但相比其余文本,該字母將是較小的字體尺寸。

語法

設(shè)置 fontVariant 屬性:

Object.style.fontVariant="normal|small-caps|inherit"

返回 fontVariant 屬性:

Object.style.fontVariant
描述
normal 默認。字體是 normal(正常的)。
small-caps 字體顯示為小型大寫字母。
inherit fontVariant 屬性的值從父元素繼承。

瀏覽器支持

Internet ExplorerFirefoxOperaGoogle ChromeSafari

所有主要瀏覽器都支持 fontVariant 屬性。

注意:IE7 及更早的版本不支持 "inherit" 值。IE8 只有規(guī)定了 !DOCTYPE 才支持 "inherit"。IE9 支持 "inherit"。


實例

實例

更改字體為小型大寫字母:

<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>小白教程(json.cn)</title>
<script>
function displayResult(){
????document.getElementById("p1").style.fontVariant="small-caps";
}
</script>
</head>
<body>

<p id="p1">This is some text.</p>
<p>THIS IS SOME TEXT.</p>
<br>
<button type="button" onclick="displayResult()">修改字體</button>

</body>
</html>

運行代碼 ?

Style 對象參考手冊 Style 對象其他擴展