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