How To Style Background in CSS

Background color is the most important part of any web design. This tutorial will help you to style your site background in CSS. You can set the color for your site background with the following code.

body {background-color:#e0ffff;}

 

 

Example :

<style type="text/css">
body
{
background-color:#b0c4de;
}
</style>

If you want to style your paragraph or heading with different color then you can add the p or h1 in the place of body, for example you want to set the background color for your paragraph then you should write this code like this

p {background-color:#e0ffff;}

Image in Background

 

 

 

If you want to place any image in your site background then you can do it with the following code.

body {background-image:url(‘yourimage.gif’);}

Example :

<style type="text/css">
body {background-image:url(‘yourimage.gif’);}
</style>

I hope this tutorial will help you in setting your background color and image in CSS. Please do share your comments in the comments section below.

Loveish Kalsi

Loveish Kalsi is a freelance Web and Graphic Designer from India. He is the owner of famous design blog Creativedesignmagazine.com

Yazara ait tüm yazılar →

Related posts:

Leave a reply