PDA

View Full Version : Bottom Margin Problem


stoneygossard
03-16-2007, 01:07 PM
Hi,

I have an image which I want to place into a table cell. I have set the image the identical same size as the cell yet when and it looks perfect in DW8, yet in IE7 and Firefox there is a gap between the bottom of image and bottom of cell. I have inserted some CSS into <td> tag e.g. style="margin:0;padding:0;" yet it makes no difference.

Here is the page:

http://www.vage.grungefreak.com/contactUs.php

Can anyone help as I am tearing my hair out with this.

I know the image quality is bad but it's only a test image, I can take care of that later.

Thanks in advance.
Stone

domedia
03-16-2007, 03:24 PM
No doctype in document, validate document first.

If you use HTML4.01 strict. It's going to fix it just by adding the doctype I think. For other doctypes you might have to turn the image into a block element. If you would design it web standards way instead of with tables this wouldn't be much of an issue ;)

stoneygossard
03-16-2007, 08:51 PM
No doctype in document, validate document first.

If you use HTML4.01 strict. It's going to fix it just by adding the doctype I think. For other doctypes you might have to turn the image into a block element. If you would design it web standards way instead of with tables this wouldn't be much of an issue ;)

Thanks for the reply. Yes I do realise the CSS/HTML way is best...just fell back to my old bad habits that's all on this one. As a matter of interest, how would I make the image a "block element"?

Stone

stoneygossard
03-16-2007, 09:07 PM
I added the doc type to it but it still hasn't resolved the problem. I have put up a new page using doc type and here's the link:

http://www.vage.grungefreak.com/contactTest.php

As you can see, the image won't align to the bottom of the table cell. Any other ideas?

Stone

stoneygossard
03-16-2007, 09:10 PM
I added the doc type to it but it still hasn't resolved the problem. I have put up a new page using doc type and here's the link:

http://www.vage.grungefreak.com/contactTest.php

As you can see, the image won't align to the bottom of the table cell. Any other ideas?

Stone

Jeez,

Sorry bout that, I actually have it right now and your suggestion was spot on as per usual dom.

Why does that actually make a difference though? The default doc type in DW8 is xhtml transitional isn't it?

Stone

domedia
03-16-2007, 09:48 PM
You're defining which standard/protocol to use in the doctype, a different version of HTML will do things a little differently. It doesn't really matter imho which one you choose, as long as you're comfortable using it. XHTML transitional is quite popular among developers, personally I try to use html4.01 strict which I know better.

In CSS you can change an inline element such as text and images to be a block element (like div's and headers) by using 'display: block'