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

Style fontWeight 屬性

Style 對(duì)象參考手冊(cè) Style 對(duì)象

定義和用法

fontWeight 屬性設(shè)置或返回字體的粗細(xì)。

語(yǔ)法

設(shè)置 fontWeight 屬性:

Object.style.fontWeight="value"

返回 fontWeight 屬性:

Object.style.fontWeight
描述
normal 默認(rèn)。字體是 normal(正常的)。
lighter 定義更細(xì)的字體。
bold 定義粗體。
bolder 定義更粗的字體。
100
200
300
400
500
600
700
800
900
定義由細(xì)到粗的字符。400 等同于 normal,700 等同于 bold。
inherit fontWeight 屬性的值從父元素繼承。

瀏覽器支持

Internet ExplorerFirefoxOperaGoogle ChromeSafari

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

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


實(shí)例

實(shí)例

更改字體粗細(xì):

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

<p id="p1">這是一些文本。</p>
<br>
<button type="button" onclick="displayResult()">修改字體粗細(xì)</button>

</body>
</html>

運(yùn)行代碼 ?

Style 對(duì)象參考手冊(cè) Style 對(duì)象其他擴(kuò)展