background-color: ***;

  • IE
  • Cr
  • Sf
  • Fx
  • O

The background-color property specifies the background color of an element.

The color of the horizontal rule can be specified by applying this property to the HR element.

hr {
background-color: red;
border: none;
height: 3px;

Property Value Explanation
background-color color code or name the background color of the horizontal rule


<title>TAG index</title>

<style type="text/css">

hr.example1 {
background-color: #ff0000;
height: 10px;

hr.example2 {
background-color: #0000ff;
border: none;
height: 1px;



<hr class="example1">

<hr class="example2">