Forum Moderators: not2easy

Message Too Old, No Replies

Doctype dilemna

Adding a doctype seems to mess things up

         

MatthewHSE

5:55 pm on Jul 28, 2003 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



I'm trying to use a strict doctype, and am running into a few problems.

First, in some of my table cells, I want to have nothing but a picture. They need to match up with one another, as they include various sections of my logo. With no doctype or with a transitional doctype, everything is fine. When I use a strict doctype, however, a space of a few pixels shows up above and below a graphic in a table cell. This doesn't happen with IE 6, but Mozilla (and I assume Netscape) adds the extra top and bottom padding. How can I fix that?

Also, when using any doctype at all, my borders display differently between IE 6 and Mozilla. It seems to only affect the right-hand border on table cells. IE 6 displays them much narrower than Mozilla. To get IE to display the border the width I want it, I have to set the border to be two or three pixels wider than where Mozilla displays it correctly.

One other problem I'm having is that Mozilla won't center my content area on the page, despite the fact that I have text-align:center in my body style.

Also, is there a way to use CSS positioning to center content in the browser, regardless of resolution?

Thanks for any answers to the above questions. I'm a little over my head when it comes to doctypes and CSS positioning, so I'll sure appreciate anything that anyone can tell me!

Thanks,

Matthew

drbrain

6:31 pm on Jul 28, 2003 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



When you add a doctype, you get standards mode rendering, which is a good thing. To fix you image problems, read this devedge article about Images, Tables, and Mysterious Gaps [devedge.netscape.com].

For your borders, IE5.5 had an incorrect interpretation of width and height in its box model. IE adds padding inside of the content box, while the standards say that padding is added outside of the content box. When use a doctype, IE obeys the standards. There's more on that Here on MSDN [msdn.microsoft.com], along with a description of other things that are affected.