Setting the Background Image
Description
We can use background-image
to
set a background image.
Example
The following code sets the Background Image.
<!DOCTYPE HTML>
<html>
<head>
<style type="text/css">
p {<!-- w w w . ja v a 2 s.c o m-->
background-image: url(http://www.java2s.com/style/download.png);
background-size: 20px 20px;
background-repeat: repeat-x;
}
</style>
</head>
<body>
<p>This is a test. <br/>
This is a test. <br/>
This is a test. <br/>
This is a test. <br/>
This is a test. <br/>
This is a test. <br/>
This is a test. <br/>
This is a test. <br/>
</p>
</body>
</html>
The default value for the z-index property is zero.