My brother and I were messing around in sublime earlier and he suddenly shout out, "I learned something new!"
A little shocked, I asked, "What's that..?"
He replied, "Viewport height! I started in I.E.6 when it wasn't fully supported and never really looked at it again." He then proceeded to show me.
To which I replied, "I accomplished the same thing here." and showed him another sandbox project I messed around with.
In my project, in the CSS, I wrote
(edit: I edited to put the background color in the div, not the html or body, my mistake)
(jsfiddle http://jsfiddle.net/nvLq8eg9/embedded/result/ )
html, body {
height: 100%;
}
div {
height: 100%;
background: green;
}
his code is,
(jsfiddle http://jsfiddle.net/nvLq8eg9/1/embedded/result/ )
div {
height: 100vh;
background: green;
}
Both did virtually the same thing. After doing some research on here, it appears as if the commonly run in to issue via the former method is the inability to scroll; however, on my sandbox project I had more content in it and was able to scroll and interact with the website normally.
Neither of us were able to determine what the differences were between both methods. Would anyone on here be able to educate us?
Thank you!
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…