htmlcss

Getting the background color for horizontal rule in html


I am using

<hr style="margin:0; padding:0; background-color: #F7D25F" />

However, the color is not showing in the rule.


Solution

  • Add border:0 and give it a height

    <hr style="margin:0; padding:0; background-color: #F7D25F; border: 0; height:1px;" />