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.
Asked
Active
Viewed 887 times
1
shahalpk
- 3,229
- 6
- 34
- 54
-
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 Answers
9
Make your image display block, like so:
figure img {
display: block;
}
Example using your code:
Michael Giovanni Pumo
- 13,625
- 16
- 88
- 133