Making a div fit the initial screen

后端 未结 10 971
谎友^
谎友^ 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:43

    If I understand correctly (there's some room for confusion here):

    http://jsfiddle.net/zRpNp/

    #screenFiller {
        position: absolute;
        top: 0; right: 0; bottom: 0; left: 0;
        border: 15px solid orange
    }
    

    You might be after the position: fixed version: http://jsfiddle.net/zRpNp/1/

提交回复
热议问题