I have the following code. I don't understand why the p element is still visible when the height is 0%. Please explain, thanks!
p {
height: 0%;
overflow: hidden;
}
<p>I am Ozi</p>
I have the following code. I don't understand why the p element is still visible when the height is 0%. Please explain, thanks!
p {
height: 0%;
overflow: hidden;
}
<p>I am Ozi</p>
Dont include percentage in height
. Just specify 0
and it works.
p {
height: 0;
overflow: hidden;
}
<p>I am Ozi</p>
SOLUTION:
p {
display: block;
line-height:0;
height: 0px;
overflow: hidden;
}
<p> hi </p>
<div>
Hi is not displayed
</div>