Jump to content

DOCTYPE problems


Lestat

Recommended Posts

Hi, need some help here with the <!DOCTYPE> declaration. When I added the

 "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

part of the DOCTYPE, Netscape and FF started displaying my page a little incorrectly. The h1 header I have at the top of the page took up much more space than normal. I used CSS to decrease line-height. It worked all right, but when I ran my website on IE, half the header was eaten away (obviously because of the decrease in line-height). So I created two different CSS stylesheets and used JS to link to each according to the user's browser. Now, that worked perfectly, but I need to understand what the problem is. How come adding the rest of the DOCTYPE changed line-spacing? Why just in Netscape and FF but in Opera and IE? Plus it seems like too much to add new script and create a whole new stylesheet just for a header.Any help there?

Link to comment
Share on other sites

Does the whole start of your document look EXACTLY like this:

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><html xmlns="http://www.w3.org/1999/xhtml">

I mean that it's just that this is how XHTML transitional should be correctly accesed. Otherwise, all browser go into quirksmode where it's completely normal to have such diferences.

Link to comment
Share on other sites

The entire decleration is set exactly as you typed it. In fact I copied it from the XHTML tutorial page and pasted it onto my webpage. I even added the xmlns attribute, even though it's done automatically. But I still have the same problem. I'm just interested in finding out what causes it because as I've already said I managed to display my pages correctly with JS.

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...