Page height to 100% of viewport?

后端 未结 4 1522
孤街浪徒
孤街浪徒 2020-12-08 10:21

I\'ll start by saying that I am very very new to web development as a whole and that this is my very first responsive site so please be gentle and bear this in mind, I am th

4条回答
  •  情话喂你
    2020-12-08 11:14

    Here’s just a simplified code example of the HTML:

    your content on screen 1
    your content on screen 2

    and here’s the CSS using vh:

    div#welcome {
        height: 100vh;
        background: black;
    }
    
    div#projects {
        height: 100vh;
        background: yellow;
    }
    

    From Here: http://stanhub.com/how-to-make-div-element-100-height-of-browser-window-using-css-only/

    It works for me.

提交回复
热议问题