ad

Thursday, 26 June 2014

CSS Background

C.S.S. Background


This post is all about the background of the webpages, and how we can use C.S.S. to make an attractive background.
But before implementing C.S.S.  for your background make your that the color of background or image that is used by you as background does not make your text unreadable, the text should be clear and grabs the attention of the viewer which is very important.

                                                               Background Color

The background-color property specifies the background color of an element.

The background color of a page is defined in the body selector by using the body selector you can select the whole body:-
body{
background-color: blue;

                                                    Using Image as Background

Using Image as background can increase the attractiveness of the webpage. 

By default, the image is repeated so it covers the entire element.
Default means that the way browser interpret it, different browser can interpret it differently,but in this case most of the browser repeat the image so it cover entire element.
  The background image for a page can be set like this:-

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



You can also set your image position and you can also set repeat or no repeat.
It can be done as
body {
    background-image: url("img_tree.png");
    background-repeat: no-repeat;
    background-position: right top;
}
You can also use the selectors if you want to give background color to specific text, line, paragraph.

No comments: