下面有更多 "亲自试一试" 示例。
这个border-style
属性设置元素的四个边框的样式。该属性可以有一到四个值。
例子:
表中的数字指定完全支持该属性的第一个浏览器版本。
Property | |||||
---|---|---|---|---|---|
border-style | 1.0 | 4.0 | 1.0 | 1.0 | 3.5 |
border-style: none|hidden|dotted|dashed|solid|double|groove|ridge|inset|outset|initial|inherit;
Value | Description | Demo |
---|---|---|
none | Default value. Specifies no border | Demo ❯ |
hidden | The same as "none", except in border conflict resolution for table elements | Demo ❯ |
dotted | Specifies a dotted border | Demo ❯ |
dashed | Specifies a dashed border | Demo ❯ |
solid | Specifies a solid border | Demo ❯ |
double | Specifies a double border | Demo ❯ |
groove | Specifies a 3D grooved border. The effect depends on the border-color value | Demo ❯ |
ridge | Specifies a 3D ridged border. The effect depends on the border-color value | Demo ❯ |
inset | Specifies a 3D inset border. The effect depends on the border-color value | Demo ❯ |
outset | Specifies a 3D outset border. The effect depends on the border-color value | Demo ❯ |
initial | Sets this property to its default value. Read about initial | |
inherit | Inherits this property from its parent element. Read about inherit |
在元素的每一侧设置不同的边框:
p.one {border-style: dotted solid dashed double;}
p.two {border-style: dotted solid dashed;}
p.three {border-style: dotted solid;}
p.four {border-style: dotted;}
亲自试一试 »
CSS教程:CSS 边框
HTML DOM 参考:borderStyle 属性
截取页面反馈部分,让我们更快修复内容!也可以直接跳过填写反馈内容!