html - Height percentage not working in CSS -
i trying use height property using percentages, doesn't work. want use percentage looks fine in resolution.
<div id="bloque_1" style="height: 80%;background: red"> </div>
how can make work?
when using %
width, or height, 1st question should ask 80%
of what? need apply height parent element, assuming element of yours inside body tag, need use in css
html, body { height: 100%; }
so div
element 80%
of 100%
side note: when dealing absolute
positioned elements, may come across scenario div
won't exceed current viewport height, in case need have min-height
Comments
Post a Comment