如何 - 样式化 HR(水平线)
了解如何使用 CSS 样式化 hr 元素。
如何样式化 HR
水平线
您可以使用 border
属性来样式化 hr
元素。
示例
/* 红色边框 */
hr.new1 {
border-top: 1px solid red;
}
/* 虚线红色边框 */
hr.new2 {
border-top: 1px dashed red;
}
/* 点状红色边框 */
hr.new3 {
border-top: 1px dotted red;
}
/* 粗红色边框 */
hr.new4 {
border: 1px solid red;
}
/* 大圆角绿色边框 */
hr.new5 {
border: 10px solid green;
border-radius: 5px;
}
自己动手试一试 »