Click here to Skip to main content
16,020,249 members
Please Sign up or sign in to vote.
3.00/5 (1 vote)
See more:
Hi.

I want to know how to stretch the backgound image in html not in any javascript or css.....

please help me...

Sudheer
Posted
Comments
Sergey Alexandrovich Kryukov 28-Feb-12 1:31am    
Google!
--SA

 
Share this answer
 
Comments
sudheer koduru 28-Feb-12 1:37am    
i'm getting the image repeat
i dont want image in repeat
Sergey Alexandrovich Kryukov 28-Feb-12 1:57am    
Really? Sorry, my bad. But the solution is somewhere close; I used to find it in Google and tested, not long time ago -- it worked. Try to Google for it, it's very similar...
--SA
Try as
use
Streched backgroungd image
HTML
<img src="myimg.jpg" width="100%" height="100%" alt="ImageShow">

</img>
 
Share this answer
 
v2
Comments
sudheer koduru 28-Feb-12 1:15am    
not in image tag sir
i want in body tag
<body bagkground="iimg.jpg">
uspatel 28-Feb-12 1:18am    
check updated answer, see link
If you want to stretch an image depending on how wide it's container is, you can do so with a relative width in your width attribute.

XML
<img src="image.jpg" width="100%" height="150">
<img src="image.jpg" width="50%" height="150">


But it stretches small images so much that we are unable to figure out actual image.
 
Share this answer
 
Comments
sudheer koduru 28-Feb-12 1:16am    
not in image tag sir
i want in body tag
<body bagkground="iimg.jpg">
Chandrakantt 28-Feb-12 1:22am    
You have to use css for stretching background. As you can see Uma has shown in his link. It uses a css.
sudheer koduru 28-Feb-12 1:30am    
kk i'll try the code

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900