Click here to Skip to main content
15,904,823 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hello,

How can I stretch the background image in a Div so that it can be shown complete in different height than its original? Actually, its a banner Div. What should I do?
Posted

This thread at stackoverflow will help you out: http://stackoverflow.com/questions/1150163/stretch-and-scale-a-css-image-background-with-css-only[^]

There is a css3 property also:
HTML
<body style="background-image: url(/image.jpg); background-repeat: no-repeat; background-size: 100% 100%;">
 
Share this answer
 
v2
<body style="background-image: url(/image.jpg); background-repeat: no-repeat; background-size: 100% 100%;">
 
Share this answer
 

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