Hi Friends, I need to apply backgroundimage to div.Here my div height and width was dynamic. My problem was If div width and height was 100px,and yhe image width and height was 50px.In this situation i need to strech the image to whole div.How can i do this .Can any one provide sample css code.Below is the code which i am using...
Please cut the image with specified width and 1px height, then repeating the image. .divbg { height:100px; width:100px; background-image:url(bg_image1.jpg) repeat-x; }
I don't think he is referring to an image which can be repeated over a particular axis. He is referring to an image which is of a particular width and height. I think you should refer to that tutorial where Chris resizes a background body image with change of browser size. May be you can get any leads from there :)
I need to apply backgroundimage to div.Here my div height and width was dynamic.
My problem was If div width and height was 100px,and yhe image width and height was 50px.In this situation i need to strech the image to whole div.How can i do this .Can any one provide sample css code.Below is the code which i am using...
<html >
<head >
<title>Untitled Page</title>
<style type="text/css">
.divbg
{
height:100px;
width:100px;
background-image:url(index_02.jpg);
}
</style>
</head>
<body>
<div id="div1" class="divbg">
</div>
</body>
</html>
Please cut the image with specified width and 1px height, then repeating the image.
.divbg
{
height:100px;
width:100px;
background-image:url(bg_image1.jpg) repeat-x;
}
Thanks & regards
With out Image Editing can we strech the image by using css
Anyway, here are the two posts that I mentioned before:
Perfect Full Page Background Image
How To: Resizeable Background Image