Header Ads Widget

What Is CSS Background Image | CSS Background Image | CSS Tutorial Class 7 | How To Learn CSS Background Image

CSS background image:-

If you want to use image in background then you have to use background-image property.

By default the image will be repeated it can be cover many ways.


<!DOCTYPE html>

<html>

<head>

<style>

body{background-image: url ("paper.gif");}

</style>

</head>

<body>

<h1> CSS background-image property!</h1>

<p> We use an image in background.</p>

</body>

</html>

Try this code for a better experience 


Now we will use an image that will disturb our text that will represent bad combination of text and background image.


<!DOCTYPE html>

<html>

<head>

<style>

body{background-image: url("bgderest.jpg")}

</head>

<body>

<h1> CSS background image property!</h1>

<p> We can not read text with this background image.</p>

</body>

</html>

Try this code for a better experience 



NOTE:- When use an image for background then use such kind of image that will not disturb the text.

The image can be specifies for an element like <p>, <h1> so on.


<!DOCTYPE html>

<html>

<head>

<style>

p{background-image: url("paper.gif");}

</head>

<body>

<h1> CSS background image property</h1>

<p> We set image for an element.</p>

</body>

</html>

Try this code for a better experience 



Post a Comment

0 Comments