HTML
<div class="top"><p>hello</p></div>
<div class="bottom"><p>hello</p></div>
CSS
.bottom {
overflow: hidden;
}
While delving into the world of CSS, I encountered an interesting query: why does applying overflow: hidden
result in a vertical shift in this demo? Removing this property or using .bottom p {overflow: hidden;}
seems to resolve the issue. I found discussions on similar topics like this one, but they mainly focus on inline-block elements, whereas my case involves block elements.