How can I stretch the background in the whole window?

I am trying to stretch the background to fill the entire HTML / CSS window.
I have seen several solutions for this, but they do not work. Every solution I come across will not work in all browsers, either Chrome will not stretch it, or IE will not stretch it, and if they both do it, firefox will be problematic.

Does anyone have a working solution that will work on all browsers? (not against javascript)

+2
source share
4 answers

I believe that there is no way to do this without creating an img element and setting its z-order from the bottom, and then adjusting the width of it. This page contains information.

: position: fixed;. IE, doctype. - , .

+1

css , body.like

body {
    background-image: url("/images/bg.jpg");
    background-repeat: no-repeat;
    background-position:center top ;
     }

. , .

0

All Articles