resting — 2010-03-05T22:07:43-05:00 — #1
I have this tables with one row containing a div. The div contained an image with height of 76px. It displays fine in FF and IE. But...it screws up in chrome!
I'm surprised cause I'd always thought Chrome and FF were based on the same engine?
Doing a offsetHeight tr check shows 113px in chrome, and 87 in FF. Is there some issue I have to take note of for chrome?
ryanreese — 2010-03-06T00:30:35-05:00 — #2
Can you post a link so we can take a look?
paulob — 2010-03-06T05:41:49-05:00 — #3
As Ryan said we'd need to see the page as Chrome doesn't normally have an issue with this.
resting — 2010-03-06T08:38:31-05:00 — #4
Actually i tried doing a simple table with a div and image. I can't recreate the height problem, but I can still see a difference in tr width for this table below between chrome n ff. FF shows 348, Chrome shows 352. Any clues?
<div class="catagory-title-wrapper"><img src="someimage.png" id="s_img"/></div>
paulob — 2010-03-06T09:12:48-05:00 — #5
I'm getting the same results for Firefox and for Chrome with the above code.
An image is an inline (replaced) element and depending on browsers, doctype etc it will be placed on the baseline of the cell and not the bottom thus pushing the cell higher to allow room for descenders.
You would need to set the image to vertical-align:bottom (or set it's display to block) to kill all the whitespace.
Remember also that any whitespace between the td tags will be treated as space between words and may increase the width/height depending on browser so always close the tag at the end of the content and don;t leave gaps.
However, I didn't see any of this issues when testing with your code above but they are common issues.
resting — 2010-03-07T22:01:40-05:00 — #6
you do? hmm..weird. i'd fixed the problem giving some fixed height to my elements.
I'll try to do another page just for testing purpose when I have the time. Thanks for checking it out though.