What is the purpose of having this...?

YesYouMay

Junior Member
What is the purpose of having this (in bold):

<!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">


If I don't have it what will happen?
 
leave it alone, it's needed to help the web browser decode the html in the correct way etc

Are you sure you should be playing with html :rolleyes:
 
Sorry Levi but change it to ~
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">

What that says that the page should conform to the most strictest way of coding a XHTML document. So all tags should be lower case and all should have a closing partner unless they are self closing.

Check out ~ http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd for more details.

Best way to learn as in learn to the highest standards from the off.
The one you have allows for mistakes.

<html xmlns="http://www.w3.org/1999/xhtml">

1 tells user agents it is a HTML document.
2. As it is a XHTML document it needs a namespace which is what the xmls attribute is.Now the namespce is a way of telling humans more about the code in the document check out XHTML namespace which is what it links to for more info. :)
 
He wasn't asking for the new and improved updated version, he was asking about it's purpose :p
 
Sorry to hijack this thread a bit but what about 1.1? The book I used said to use 1.0 but then I saw 1.1 on W3C so I changed to that. Should I still be using 1.0?
 
Back
Top