-1

http://www.milknhny.co.uk/blog/

Ive wrapped my image in a black box, with the following css code:

.thumbnailwrap {
background: #000000;
display: table;
}

For some reason there is a VERY small black area at the base of the image which i cannot see where the padding is coming from.

Please can i ask advice where to look? Thanks

Kirsty Marks
  • 483
  • 8
  • 29

4 Answers4

1

Create a rule for your images like:

.thumbnailwrap img {
    vertical-align:top;
}
j08691
  • 204,283
  • 31
  • 260
  • 272
0

If you inspect the element you will notice that the black line is coming from

.thumbnailwrap { background: #000}

Change this in your CSS and you should be good to go!

Matt
  • 2,500
  • 1
  • 16
  • 26
0

if u dont need background property.

   .thumbnailwrap {
    background: #000000; --> Remove this from your CSS. I tested and it works
    display: table;
    }
NiRUS
  • 3,901
  • 2
  • 24
  • 50
  • The background is clearly there to show where the image will be loaded as it is loading. Another use for it would be for transparent PNGs, giving them a background (I have used this effect in the past), but that's not the case here. – Niet the Dark Absol Jun 26 '13 at 18:43
0

Inline elements (or elements that may be displayed inline, such as tables, inline-blocks, images, etc.) are always aligned with respect to the baseline. This is the line drawn across the bottom of the letters in this sentence. Occasionally though letters may drop below the baseline, as in this one (y, g, p). For this reason, the baseline and the bottom line are not the same - otherwise the tails of letters would collide with the heads of the ones below.

This is why there will be a small gap underneath images in this way.

Personally, I like to add img{vertical-align:bottom} to my CSS. I can always override it for specific images (such as middle where useful) and this aligns the image to the bottom line.

Niet the Dark Absol
  • 320,036
  • 81
  • 464
  • 592