How display a colored line in html?

I'm unable to use the style-color for tag "hr". Could someone help me me to display a colored line on the my jsp page using html?


<hr>不使用颜色,它使用border-color


您可以应用边框颜色而不是颜色

<style>
hr { 
    display: block;
    margin-top: 0.5em;
    margin-bottom: 0.5em;
    margin-left: auto;
    margin-right: auto;
    border-style: inset;
    border-width: 1px;
border-color:red;
} 
</style>

hr:first-child{color:red;}
hr:nth-child(2){color:yellow;}
hr:last-of-type{color:blue;}
<hr><hr><hr>
链接地址: http://www.djcxy.com/p/15746.html

上一篇: 如何在闪亮的应用程序中绘制颜色线

下一篇: 如何在html中显示一条彩色线?