The background-image property uses the url() syntax to specify a background-image.
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns='http://www.w3.org/1999/xhtml' xml:lang='en'>
<head>
<title>background-image</title>
<style type='text/css'>
body {
background-image: url('http://java2s.com/style/logo.png');
}
p {
background-color: #fff;
padding: 3px;
margin: 3px;
border: 1px solid rgb(244, 244, 244);
width: 200px;
margin: auto;
}
</style>
</head>
<body>
<p>
The background-image property uses the url() syntax to specify
a background-image. The image is tiled along the x-axis and
the y-axis.
</p>
</body>
</html>
Related examples in the same category