4

I know that browser add a little extra-space underneath inline-elements. For to accomodate the "tail" of characters like j, q, y.

One possibility to get rid of that space is to add a "vertical-align: top" property to the particular element:

figure img {
    vertical-align: top;
}

It works. I've tried that.

But I don't understand how and why it works.

I would expect the figure-container to keep it's size and the img put on the very top of the figure-container.

Why collapses the container instead?

Can someone explain me the behaviour which is used here to remove the undesired bottom-space?

bew5
  • 167
  • 1
  • 1
  • 7

1 Answers1

0

'vertical-align' does not affect the alignment of the addressed element. 'vertical-align' specifies how the inline elements should behave around the inline element. I think with the background knowledge you can also explain the further behavior.

I apologize for my knowledge of English in advance. : P