在 <div> 元素周围添加 "solid" 轮廓:
document.getElementById("myDiv").style.outlineStyle = "solid";
亲自试一试 »
profileStyle 属性设置或返回元素周围轮廓的样式。
轮廓是元素周围的一条线。它显示在元素的边缘周围。但是,它与边界属性不同。
轮廓不是元素尺寸的一部分,因此元素的宽度和高度属性不包含轮廓的宽度。
Property | |||||
---|---|---|---|---|---|
outlineStyle | Yes | Yes | Yes | Yes | Yes |
返回轮廓样式属性:
object.style.outlineStyle
设置轮廓样式属性:
object.style.outlineStyle =
value
Value | Description |
---|---|
none | Defines no outline. This is default |
hidden | The outline is turned off |
dotted | Defines a dotted outline |
dashed | Defines a dashed outline |
solid | Defines a solid outline |
double | Defines a double outline |
groove | Defines a 3D grooved outline. The effect depends on the outline-color value |
ridge | Defines a 3D ridged outline. The effect depends on the outline-color value |
inset | Defines a 3D inset outline. The effect depends on the outline-color value |
outset | Defines a 3D outset outline. The effect depends on the outline-color value |
initial | Sets this property to its default value. Read about initial |
inherit | Inherits this property from its parent element. Read about inherit |
默认值: | 没有任何 |
---|---|
返回值: | 一个字符串,表示元素轮廓的样式 |
CSS版本 | CSS2 |
所有不同值的演示:
var listValue = selectTag.options[selectTag.selectedIndex].text;
document.getElementById("myDiv").style.outlineStyle = listValue;
亲自试一试 »
CSS教程:CSS 外轮廓
CSS 参考:外轮廓样式属性
HTML DOM 参考:外轮廓属性
截取页面反馈部分,让我们更快修复内容!也可以直接跳过填写反馈内容!