Full Page Background image
How to make an background image scalable base up on screen resolution using HTML ? My image is 2200x2200
Know the answer? Post it — somebody with the same question will find it here.
Sign in to answer this question
It is the same account you read, post and publish with — and you will come straight back to this page.
Sharad RathorePosted Aug 10, 2013, 3:51 PM
Try like this
body
{
background-image: url(title.gif);
background-repeat: no-repeat;
}
Regards,
Sharad kumar rathore
Iftikar HussainPosted Aug 1, 2013, 11:56 PM
Regards,
Iftikar
David SmithPosted Aug 1, 2013, 1:58 PM
Iftikar HussainPosted Aug 1, 2013, 11:30 AM
Regards,
Iftikar
Iftikar HussainPosted Aug 1, 2013, 11:29 AM
Regards,
Iftikar
David SmithPosted Aug 1, 2013, 9:02 AM
David SmithPosted Aug 1, 2013, 8:51 AM
David SmithPosted Aug 1, 2013, 8:49 AM
The solution i posted work. I can see the entire image upon resize with no problem.
ftikar Hussain is it better to use javascript instead?
Sunny SharmaPosted Aug 1, 2013, 8:16 AM
Iftikar HussainPosted Aug 1, 2013, 8:13 AM
Regards,
Iftikar
David SmithPosted Aug 1, 2013, 8:06 AM
Review code below to see what I am going. I got it to work. As the page resolution gets bigger or smaller, the layout changes.
CSS:
HTML CODE:
Iftikar HussainPosted Aug 1, 2013, 7:54 AM
Try like this
Regards,
Iftikar
Sunny SharmaPosted Aug 1, 2013, 7:44 AM
Follow the style below:
---------------------
body
{
margin:0;
background:url(http://www.all-hd-wallpapers.com/wallpapers/abstract/330021.jpg) no-repeat fixed top center;
background-color:#000001;
background-size:100%;
}
----------------------
Keep the Background-color matching to your image for just in case the image is loading or can't be loaded. It will maintain the feel of your image till it get's fully loaded. Size will not matter to make it in full background but yes, it may be sucking your bandwidth. I would suggest you to reduce the size as far it fits and looks good.
Hope it helps.
Cheers!