如何创建一个虚线<hr />标签?

时间:2013-05-29 16:59:54

标签: html css

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

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

还是有其他技巧吗?

6 个答案:

答案 0 :(得分:134)

你可以拥有<hr style="border-top: dotted 1px;" />。这应该有用。

答案 1 :(得分:26)

hr {
    border-top:1px dotted #000;
    /*Rest of stuff here*/
}

答案 2 :(得分:14)

hr {
    border: 1px dotted #ff0000;
    border-style: none none dotted; 
    color: #fff; 
    background-color: #fff;
}

试试这个

答案 3 :(得分:10)

你可以这样做:

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

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

答案 4 :(得分:8)

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

<hr style="border-style: dotted;" />

答案 5 :(得分:7)

你可以这样做:

<hr style="border-bottom: dotted 1px #000" />