Why Do Divs Refuse to Match Image Height?

  • # May 10, 2013 at 11:17 am

    [http://codepen.io/anon/pen/elvmA](http://codepen.io/anon/pen/elvmA “”)

    I’ve never quite understood why there’s a margin added to the bottom of the div in scenarios like that above. What is the least code-intensive way to fix this issue? I’ve actually found solutions via jQuery which is complete overkill.

    # May 10, 2013 at 11:20 am

    Add `display:block`

    http://codepen.io/Paulie-D/pen/IchFd

    # May 10, 2013 at 11:42 am

    This reply has been reported for inappropriate content.

    Thanks @Paulie_D – as always, it is appreciated.

Viewing 3 posts - 1 through 3 (of 3 total)

You must be logged in to reply to this topic.

There's a whole bunch of content on CSS-Tricks.

Search for Stuff   •   Browse the Archives

Get the Newsletter ... or get the RSS feed