Skip to content Skip to sidebar Skip to footer

Why Is Only Part Of Cell Top Aligned?

I have markup looking something like this: The key problem is vertical alignment of text in cells with an image. For whatever reason, it is aligned to bottom, but I expect it to b

Solution 1:

You image is not aligned properly using vertical-align therefore the text next to it is at the baseline of your image

Use:

tableimg{
  vertical-align:top;
}

jsBin playgroundhttps://developer.mozilla.org/en/docs/Web/CSS/vertical-align

Solution 2:

You’ll need to align the images as well – right now, image and text are sitting on one “line”, and with the image aligned to the baseline by default, this is the effect you’ll get.

img { vertical-align: top; }

This will fix it.

Post a Comment for "Why Is Only Part Of Cell Top Aligned?"