如何创建虚线 < hr/> 标记?

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

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

还有其他的把戏吗?

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

The <hr> tag is just a short element with a border:

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

You can do:

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

Demo: http://jsfiddle.net/JMfC9/

You can do:

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

You could just have <hr style="border-top: dotted 1px;" /> . That should work.

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

Try this