fontStyle 属性设置字体的风格。
</>code
- Object.style.fontStyle=normal|italic|oblique
值 | 描述 |
---|---|
normal | 默认。浏览器显示一个标准的字体。 |
italic | 浏览器会显示一个斜体的字体。 |
oblique | 浏览器会显示一个倾斜的字体。 |
本例向文本添加斜体样式:
</>code
- <html>
- <head>
- <script type="text/javascript">
- function setFontStyle()
- {
document.getElementById("p1").style.fontStyle="italic";
- }
- </script>
- </head>
- <body>
- <p id="p1">This is an example paragraph.</p>
- <input type="button" onclick="setFontStyle()"
- value="Change font-style" />
- </body>
- </html>
如对本文有疑问,请提交到交流论坛,广大热心网友会为你解答!! 点击进入论坛
Powered by 365建站网 RSS地图 HTML地图
copyright © 2013-2024 版权所有 鄂ICP备17013400号