Filter (Advanced Search)
Downloads
2
Views
280
Video

Background Image on a Page | Images

Details

If you want the entire page to have a background image, you must specify the background image on the <body> element:

Example

Add a background image for the entire page:

<style>
body {
  background-image: url('img_girl.jpg');
}
</style>


<!DOCTYPE html>
<html>
<head>
<title>Background Image on a Page
</title>
</head>
<body>

<h2>Background Image on a Page
</h2>

<p>By default, the background image will repeat itself if it is smaller than the element where it is specified, in this case the body element.</p>

</body>
</html>


Output


Ad