Forums

The forums ran from 2008-2020 and are now closed and viewable here as an archive.

Home Forums CSS Pesky, Linked Space Under Images

  • This topic is empty.
Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #44492
    siouxfan45
    Participant

    This is officially driving me insane. I’m making a most popular posts sidebar display and the images have a bit of an extra space under them which is being linked that I would like to get rid of.

    [In this example](http://themeforward.com/demo2/ “”), you can see it in green in the sidebar on the right.

    To make troubleshooting a bit easier, I’ve thrown it into Codepen without the colors. You may notice that the pesky linking space is still being created under each image.
    [http://codepen.io/anon/pen/ybIeB](http://codepen.io/anon/pen/ybIeB “”)

    #133788

    Not sure exactly why but setting font-size to 0 on the a tag containing the image seems to have fixed the problem.

    #133792
    CrocoDillon
    Participant

    It’s a common thing with img elements, because they are inline elements with their bottom vertical aligned to text baseline (even if there isn’t any text around it, that causes the gap, that’s why font-size: 0 works too). Setting the `vertical-align` property of the `img` to almost anything but `baseline` fixes this.

    #133795
    TheDoc
    Member

    I almost always go with a `display: block;` on the image.

Viewing 4 posts - 1 through 4 (of 4 total)
  • The forum ‘CSS’ is closed to new topics and replies.