How TO - Style HR (Horizontal Ruler/Line)


Learn how to style an hr element with CSS.


How To Style HR







Horizontal Line

You can use the border property to style a hr element:

Example

/* Red border */
hr.new1 {
  border-top: 1px solid red;
}

/* Dashed red border */
hr.new2 {
  border-top: 1px dashed red;
}

/* Dotted red border */
hr.new3 {
  border-top: 1px dotted red;
}

/* Thick red border */
hr.new4 {
  border: 1px solid red;
}

/* Large rounded green border */
hr.new5 {
  border: 10px solid green;
  border-radius: 5px;
}
Try it Yourself »

Related Pages

The HTML hr tag.



Copyright 1999-2023 by Refsnes Data. All Rights Reserved.