HTML
<div class="top"><p>hello</p></div>
<div class="bottom"><p>hello</p></div>
CSS
.bottom {
overflow: hidden;
}
I have stumbled upon this question while learning CSS basics: why does overflow: hidden
causes a vertical shift in this example? Everything works as expected when removing this property or using .bottom p {overflow: hidden;}
. I saw similar questions but they are about inline-blocks
(and in my case everything is block
if I'm not mistaken).