How can I load images to cover the whole background like some websites, using CSS. Not the usual background-image property but I want to load the images quickly.
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
background-imageis the only way to place images in CSS. If you want it to be vary large put it on thebodyelement or a containerdivthat fills the entire viewport.If you use a container
divyou can setposition:fixed; top:0; left:0and the image will remain stationary when the page scrolls.There’s no magic to it. As far as getting it to load quickly I don’t think there’s much you can do if it doesn’t repeat. If it does repeat then make sure your image is the size of one module. This can be as little as one pixel tall or wide depending on the content.