HTML DOM outlineColor 属性

HTML DOM Style 对象

定义和用法

outlineColor 属性设置元素周围的轮廓的颜色。

语法:

Object.style.outlineColor=color-name|color-rgb|color-hex

实例

本例改变轮廓的颜色:

<html>
<head>
<style type="text/css">
p
{
border: thin solid #00FF00;
outline: thick solid #FF0000;
}
</style>
<script type="text/javascript">
function changeOutlineColor()
{
document.getElementById("p1").style.outlineColor="#00FF00";
}
</script>
</head>
<body>

<input type="button" onclick="changeOutlineColor()"
value="Change outline color" />

<p id="p1">This is a paragraph</p>

</body>
</html>

TIY

outlineColor - 改变围绕元素的轮廓的颜色(请在非 IE 浏览器中浏览)

HTML DOM Style 对象