سؤال

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

هل كانت مفيدة؟

المحلول

Make your image display block, like so:

figure img {

display: block;

}

Example using your code:

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

مرخصة بموجب: CC-BY-SA مع الإسناد
لا تنتمي إلى StackOverflow
scroll top