By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
437,648 Members | 1,198 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 437,648 IT Pros & Developers. It's quick & easy.

DTD: XHTML and CSS

P: 16
I've just taken over a website that somebody else built and I'm trying to tidy it up and sort out a few problems. I've not built a site for a while and certainly nothing as complicated as this one and things have moved on a bit, so I am trying to absorb CSS for layout, whereas in the past I used tables.

My first question concerns the DOCTYPE. Reading drhowarddrfine's post about this, I see that the site I've inherited uses a different declaration:

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xml:lang="en">
<head> ...

Should I be using the 'strict' version

<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>...

recommended by W3C, or will the declarations that came with the website be OK? I've found a few strange activities in IE/Win which I'm slowly sorting out, but I'm wondering to what extent the DTD is responsible.

Thank you.
Jan 25 '07 #1
Share this Question
Share on Google+
2 Replies


drhowarddrfine
Expert 5K+
P: 7,435
Xhtml version 1.1 is a modular version of xhtml and should never be served as text/html. You are probably doing this so using 1.1 is wrong. Drop back to 1.0.

As stated in the sticky, IE does not know anything about xhtml served as xhtml. So using the xml declaration at the head will only throw it into quirks mode.

Unless you are serving your pages as text/xhtml+xml, the xml declaration does you know good anyway so just remove it. Other than that, your second doctype is the one you should use.
Jan 25 '07 #2

P: 16
Other than that, your second doctype is the one you should use.
Thank you very much. Now to see what goodies that throws up...

Helen
Jan 25 '07 #3

Post your reply

Sign in to post your reply or Sign up for a free account.