Home › Forums › CSS › CSS Height by percentage › Reply To: CSS Height by percentage
November 19, 2013 at 6:53 am
#156507
janet4now
Participant
body, html { width: 100%; height: 100%; }
.div1 { background: blue; height:10vh; } .div2 { background: red; height:30vh; } .div3 { background: green; height:60vh; }
Use “vh” which is “viewport height” rather than % or pixels.