All TalkersCode Topics

Follow TalkersCode On Social Media

devloprr.com - A Social Media Network for developers Join Now ➔

Full Page Background Image Using HTML And CSS

Last Updated : Jul 1, 2023

IN - HTML CSS | Written & Updated By - Dikshita

In this tutorial we will show you how to add full page background image using HTML and css. We are going to replace the background of a webpage with the image. You may also like fullscreen background video using HTML5.

Full Page Background Image Using HTML And CSS

To Add Full Page Background Image It Takes Only One Step:-

  1. Make a HTML file and define markup and styling

Step 1. Make a HTML file and define markup and styling

We make a HTML file and save it with a name image_background.html

<html>
<head>
<style>
body
{
 text-align:center;
 width:100%;
 margin:0 auto;
 padding:0px;
 font-family:helvetica;
 background-color:#81DAF5;

 background: url(images/image1.jpg) no-repeat center center fixed; 
 -webkit-background-size: cover;
 -moz-background-size: cover;
 -o-background-size: cover;
 background-size: cover;
}
#wrapper
{
 text-align:center;
 margin:0 auto;
 padding:0px;
 width:995px;
}
h1
{
 margin-top:150px;	
 color:white;
 font-size:45px;
}
</style>
</head>
<body>
<div id="wrapper">
 <h1>Full Page Background Image Using HTML And CSS TalkersCode.com</h1>
</div>
</body>
</html>

In this step we create a simple markup and use css background property to add image to body background. You may also like animated background using CSS3.

Thats all, this is how to add full page background image using HTML and CSS. You can customize this code further as per your requirement. And please feel free to give comments on this tutorial.

I hope this tutorial on full page background image helps you and the steps and method mentioned above are easy to follow and implement.