1

I'm trying to add an image inside the figure tag, but its leaving a small 4px space under the image, which becomes very obvious on adding a border to figure. I could not set width to figure tag, since the width of the image is unknown while the html is rendered.

http://codepen.io/shahalpk/pen/cltAn

shahalpk
  • 3,383
  • 7
  • 36
  • 55
  • Not quite sure I understand but looking at your example, I added a border and there is no 4px space underneath the 300x300 image. – Glitchezz May 15 '14 at 16:58

1 Answers1

9

Make your image display block, like so:

figure img {

display: block;

}

Example using your code:

http://codepen.io/anon/pen/dazFt

Michael Giovanni Pumo
  • 14,338
  • 18
  • 91
  • 140