javascript fontWeight屬性
翻譯結果:
英 [fɔnt weit] 美 [fɑnt wet]
[計][WIN]字體灰階
javascript fontWeight屬性語法
作用:設定字元的粗細。
語法:Object.style.fontWeight=value
javascript fontWeight屬性範例
<html> <head> <script type="text/javascript"> function setFontWeight() { document.getElementById("p1").style.fontWeight="900"; } </script> </head> <body> <p id="p1">This is an example paragraph.</p> <p>This is another example paragraph.</p> <input type="button" onclick="setFontWeight()" value="Display bold text" /> </body> </html>
執行實例 »
點擊 "執行實例" 按鈕查看線上實例