Friday, February 12, 2010

CSS Background Position

The CSS background position is nothing but how we change a background of we gage using CSS. The full form of CSS means cascading style sheets. The main purpose of using CSS means we can set different fonts, colors to the page for example if we want to change
The background as black color we should write the code as below
body
{
background-color=”black”;
}
In this way if we want to change background image it should be written as shown below
body
{
background-image=”child.jpg”;
}
In this way we can change background using following properties
top left;
top right;
center right;
center left;
center top;
center bottom;
bottom left;
bottom right;
x position,y position;
inherit: which specigies that the positions of x and y are inherited from the parent element;
Syntax: background position :< value>
value:% value [center|top|bottom][right|left|center]
appiles to:block level and replaced elements
The background property value gives the initial poison of background image.
For example the below code will explain the usage of background positioning using cascading style sheets.
body
{
background-color=”red”;
}

The usage of cascading style sheets </title. <br /><h1> the example of the background color cascading style sheets </h1> <br /><body> <br /><h2> the usage is very lot of cascading style sheets when we use them as background </h2> <br /><h3> this is an example of cascading style sheets </h3> <br /><h4> we have different properties to be used <h4> <br /><h5> we can make web page as we want to change </h5> <br /><h6> this is the main usage of cascading style sheets </h6> <br /></body> <br /></html> <br />The above program will give the out put as like below <br />the example of background color using cascading style sheets <br />The example of body background color using cascading style sheets <br />the usage is very lot of cascading style sheets when we use them for background changing <br />This is an example of using cascading style sheets we have different properties to be used <br />we can make web pages as went to change <br />this is the main usage of cascading style sheets <br />The easiest way to assign background position is with keywords <br />Horizontal keywords ( left center right ); <br />Vertical keywords ( top center bottom ); <br />we can change the height and width of an image by mentioning them with values <br />If we give beyond the values it will lead to appear the image ugly <br />the background position will give the intial position of the image we can change that bye <br />using cascading style sheets <br />syntax: background-repeat; <br />The above syntax will be used to repeat the image as how many wants we want to change <br />now let me explain the above property with an example <br />body <br />{ <br />background-repeat (“6”); <br />} <br />This is the main functionality of the background repeat which leads to repeat an image <br />6 times <br />now let me explain this by writing html code <br /><html> <br /><title> the example of background repeat

the background repeat will permit us to repeat the background as how many wants to repeat as we want






This is very easy for CSS background-position you can just add the image to the background. Which types of image add you web page, you have to look at construct page of area and then put the image considering both horizontally and vertical.

No comments:

Post a Comment