Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

DOCTYPES and css

Status
Not open for further replies.

naifyboy

IS-IT--Management
Jan 10, 2004
62
EU
hi

i am really struggling with doc types.

i never bothered putting the code in before and my site worked perfect using external css for all its positioning.

i then added the following code and all worked fine still:

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">

then i read up in a few places that i needed to put a url at the end of the code and changed it to:

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" "
after doing this all my positioning is now totally changed and i am having to change the css. this isn't so much of a problem, but my site uses shopping cart software called Storefront. This is written in asp.net. i am finding that if i change the css, my own pages are fine but the automatically generated shopping cart pages are now screwed.

do i need to put the url at the end or can i get away with the first example (without the url)?
everyting is fine without the url.

how important is this stuff?

thanks guys
 

how important is this stuff?

Not very, unless:

- You want your pages to validate, and

- You want your pages to have the best chance of looking the same across most new browsers.

Hope this helps,
Dan



The answers you get are only as good as the information you give!

 
thanks dan

but how important is it to get your pages to validate?
i'm not too worried about cross browser support at the moment, just wondered about the validation.

thanks again
 
Without the URL it is the same as not having it -- as you have found out for yourself. Doctype is an excellent thing that forces browsers to display the page in standards mode as opposed to the quirks mode which is used when no (or partial) doctype is present. This does not make much of a difference in Geckos (NN, FF, Mozilla) but does in other browsers (Opera, IE6). IE5* does not support any standards mode so it does not matter there.

If your site changes a lot when you put the doctype in it means it wasn't coded to standards. With the doctype, your IE shows the page just how people see it in Gecko browsers. From here you have to make a decision -- support the Geckos and fix the css to work correctly in those browsers (putting a doctype at the top will help IE do almost the same) or forget the Geckos and doctypes and go for quirks in IE. If you paid for the shopping cart system I suggest you call them up and ask why their system is not cross-browser compliant and request them to fix the problem.
 

It is only as important as you require it to be.

There is no law in any country I know of that says your pages must validate!

Dan



The answers you get are only as good as the information you give!

 
thank you vragabond - a sensible answer on this issue at last.

thanks
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top