89

如何使用 CSS 创建虚线或任何类型的 hr 线(双线、虚线等)?

<hr style="...what should I write?..." />

还是有其他技巧?

4

6 回答 6

167

你可以有<hr style="border-top: dotted 1px;" />。那应该行得通。

于 2013-05-29T17:02:25.527 回答
32
hr {
    border-top:1px dotted #000;
    /*Rest of stuff here*/
}
于 2013-05-29T17:01:18.073 回答
21
hr {
    border: 1px dotted #ff0000;
    border-style: none none dotted; 
    color: #fff; 
    background-color: #fff;
}

试试这个

于 2013-05-29T17:04:16.833 回答
14

你可以做:

<hr style="border: 1px dashed black;" />

演示:http: //jsfiddle.net/JMfC9/

于 2013-05-29T17:01:46.797 回答
9

<hr>标签只是一个带有边框的短元素:

<hr style="border-style: dotted;" />
于 2013-05-29T17:01:45.030 回答
8

你可以做:

<hr style="border-bottom: dotted 1px #000" />
于 2013-05-29T17:02:05.323 回答