Do you want to buy me a beer or coffee?

Tuesday, March 3, 2009

little trick: how to resize the background image?

As you found out, it is not possible to resize background-images (nor
'size-to-fit') with CSS 2.1.
There are plans to introduce in CSS 3, but that is still only at a
draft level. No browser support this (of course).

but we have little trick to resize the background image. if not for whole page. then need some with js script. go search "jquery.js" and "resize background image" with google

<img id="background-img" class="bg" src="yourimagename.jpg" alt="" />
.bg {
width: 100%;
height:*;
position: absolute;
top: 0;
left: 0;
z-index: -1;
}

0 comments:

Post a Comment

<--nothing-->