Link to home
Start Free TrialLog in
Avatar of smitty62
smitty62Flag for United States of America

asked on

What doctype should I use

The doctypes on the website I'm currently working on is:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html lang="en">

I had to change it is that the new CSS dropdown menu would work.  This is an old site that is non-accessible compliant, and I want to change everything from tables to CSS.  This is what I changed it to:
<!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">
<html lang="en">

Is that correct, or is there something better/newer I should be using?
Avatar of Dave Baldwin
Dave Baldwin
Flag of United States of America image

Neither of those is quite right.  Here is the list of recommended DOCTYPES: http://www.w3.org/QA/2002/04/valid-dtd-list.html  You should use the one that matches your code.  It does actually make a difference.  The 'easiest' one to me is :

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
   "http://www.w3.org/TR/html4/loose.dtd">

<html>

If you use an XHTML DOCTYPE, you should make sure your code matches the XHTML rules.
Avatar of smitty62

ASKER

Thanks for the info.  I didn't know some of the DOCTYPES were going to be phased out.  I noticed that when changing asp pages from the old table style to CSS that dropdown CSS menus wouldn't work with the old DOCTYPE.  When I changed the DOCTYPE it altered the look of the CSS on the pages.  

What do you think about usine an include for DOCTYPEs, Meta Tages, Links, and CSS so that everything can be changed on all pages at once, or is that not a good idea?

Do you know of any good sites that can educate me about DOCTYPEs?
ASKER CERTIFIED SOLUTION
Avatar of Ray Paseur
Ray Paseur
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Thank you for your help.
Thanks for the points!  It's a great question. ~Ray