Link to home
Start Free TrialLog in
Avatar of Kimberly_B
Kimberly_BFlag for United States of America

asked on

Can't get image to exact bottom of cell

Hello Experts.

I have a banner image 148 px tall to be displayed in a table cell.  I want the image in this cell/row to be vertically adjacent to the pixels of the cell/row beneath it. Both Firefox and Chrome are showing that the inspected cell/row has a height that is being "calculated" at 151px.   This leaves an annoying 3px space between rows.

Everything I'm doing with border-collapse=collapse; or HTML cell spacing/padding or alignment is not having any effect.

Advice?
Avatar of MikeMCSD
MikeMCSD
Flag of United States of America image

Did you trying settting the Vertical align property of the row beneath the image to "top"?
Table cells will accomodate in order for the sum of all rows add up to the table height.
Maybe there is content missing in subsequent table rows, and this particular row gets taller.
You have to ask yourself these 2 questions:
1. Is cellpadding & cellspacing & border = 0?
2. How is the height of table cells in this row being specified?
Avatar of Hagay Mandel
Add vertical-align: bottom; to your image css, and don't assign height to the table's row.
ASKER CERTIFIED SOLUTION
Avatar of Chris Stanyon
Chris Stanyon
Flag of United Kingdom of Great Britain and Northern Ireland image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of Kimberly_B

ASKER

Yay!

This worked in my CSS:  img { display:block; }


img {display: inline-block; } did not work.  Don't know why.  FYI.

Thank you!  Brilliant solution!

(thank you also to the other responses.  None of them worked, but thanks anyway)