Making a div fit the initial screen

后端 未结 10 980
谎友^
谎友^ 2020-12-04 17:49

I want to make a div fit the initial height and width of a users screen.

I think the following crudely drawn diagram explain this better:

10条回答
  •  醉话见心
    2020-12-04 18:53

    another way to do this with CSS only...

    http://jsfiddle.net/pxfunc/qQ45K/

    html, body {height:100%;} /* explicitly set html & body height */
    
    #fillScreen {
        position:relative;
        top:0;
        left:0;
        height:100%;
        width:100%;
    }
    

提交回复
热议问题