As you can see, if there’s not enough text, the bottom gray line goes way higher than it should. Can someone please explain why doesn’t “article”‘s hitbox include the “header”? And how ti fix it? Thanks.
http://zergxost.com/test.html As you can see, if there’s not enough text, the bottom gray line
Share
You’re missing a either a
overflow: hiddenor aclear: leftdeclaration. You should always clear floating objects or declare overflow to be hidden (carefully!).Or:
Why/how
overflow: hiddenworksWhen you set a block-level element to have
overflow: hidden, you’re actually telling the browser change how it handles block elements. Functionally, you told the browser to contain normal elements (including floated ones). Things that will exceed the total dimensions of the box, usually by relative/absolute positioning, or images with huge widths, will get clipped to the wrapper’s width. Drop down regions that cross over a container withoverflow: hiddenmay cause them to get clipped as they enter as well.Elements at the end of a
overflow: hiddencontainer will also have padding-bottom and margin-bottom applied.Another answer: https://stackoverflow.com/a/3416217/24950