can anyone suggest html/ css code for auto resizing background image to fit screen width
varundeveloper
0
Newbie Poster
Recommended Answers
Jump to Postcan anyone suggest html/ css code for auto resizing background image to fit screen width
Define it as a normal image, and set this style:
.background { position:absolute; top:0; left:0; width:100%; z-index:-1; }
Then use:
<img class='background' src='sourcefile'>Oh, in the subject line you write div …
Jump to Postthanks for that.....
But still i need to fit the image within my pre-set div width....
and i want to do it using only css/html....width=100%; should do the trick, but you may have to experiment with the positioning. I'm not 100% sure about it and don't have the inclination …
All 5 Replies
Reply to this topic
Be a part of the DaniWeb community
We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.