HTML DOM fontVariant 属性

HTML DOM Style 对象

定义和用法

fontVariant 属性用于设置小型大写字母的字体显示文本。

语法:

Object.style.fontVariant=normal|small-caps

可能的值

描述
normal 默认。浏览器会显示一个标准的字体。
small-caps 浏览器会显示小型大写字母的字体。

实例

本例把第一段设置为小型大写字母:

<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>

HTML DOM Style 对象

系统帮助 | 给我留言 | 收藏本站
Copyright © 2005-2008 www.cnn84.com All Rights Reserved Ver:2.0
CNN84网是公益性便民网站,是为了给大家的日常生活查询及提供最快捷的出行指南