background-image: url(***);

Browser
  • IE
  • Cr
  • Sf
  • Fx
  • O

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

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


hr {
background-image: url(image/back.gif);
height: 10px;
}

Property Value Explanation
background-image url(URL) the URL of the image to display

The background-repeat and background-position properties can be specified at the same time.

Example


<html>
<head>
<title>TAG index</title>

<style type="text/css">

hr.example1 {
background-image: url(image/back1.gif);
height: 14px;
}

hr.example2 {
background-image: url(image/back2.gif);
height: 14px;
background-color: #e2f5e0;
background-repeat: no-repeat;
background-position: right;
}

</style>

</head>
<body>

<hr class="example1">

<hr class="example2">

</body>
</html>

Output


Background Image back1.gif
Background Image back2.gif