Jump to content

doc type help


abyssXX
 Share

Recommended Posts

It is so the browser knows what version/type of HTML/XHTML you are trying to write. Also the W3C validator uses it as well to check your syntax.

but what does the link do?
<!DOCTYPE htmlPUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN""http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">

Link to comment
Share on other sites

It points to a URL which stores the syntax rules the validator/browser must follow. Beware that browsers most of the times don't use the descriptions there, but only use the URL to check the language (ensure that's the one). Validators however, do use it.

Link to comment
Share on other sites

It points to a URL which stores the syntax rules the validator/browser must follow. Beware that browsers most of the times don't use the descriptions there, but only use the URL to check the language (ensure that's the one). Validators however, do use it.

so can i use the doctype that is provided by w3schools or do i need to change anything?
Link to comment
Share on other sites

For XHTML 1.0 Strict at least- You don't need to change anything. Use the DTD provided at W3Schools. For other kinds of (X)HTML you'll need to find that DTD instead though. For example the XHTML 1.1 is:

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

Every DTD is described in the specification of the targeted language :) . It's always fixed, so when you have it, you don't change anything in it.

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
 Share

×
×
  • Create New...