Written By:-Avinash Malhotra
Our Website:- Tech Altum
Lets see how an image comes in background?
Lets have a div with width 100%, height:500px and background:url(http://techaltum.com/images/01.jpg);
We will see following results;
Div with
width:653px;
height:400px;
and background image as shown.
But as we can see that the image does'nt fit in the div.width:653px;
height:400px;
and background image as shown.
Actually image size is lesser than div size.
So we need to customize both width and height of image according to the div size.
Various other properties of background are:
Background-repeat:
It has following value:
- Repeat-x; Background will repeat only in X axis, means horizontally .
- Repeat-y; Background will repeat only in Y axis, mean vertically.
- no-repeat; background image will never repeat. will show its actual size only once.
Background-attachment:
It has following value:
- scroll; which is by default.
- fixed; background image will nor scroll, but content will.
No comments:
Post a Comment