Jump to content
Sign in to follow this  
ajkaramba

<!DOCTYPE> and DTD question

Recommended Posts

Hello!

 

I'm a beginner when it comes to XHTML/HTML and therefore I have a question. As far as I know you are supposed to tell the browser what (X)HTML version the document uses in the <!DOCTYPE>-tag and then the browser will "understand" and read the document correctly. But you also provide a link to a DTD that says exactly what elements are allowed etc.

 

My question: Does the browser read the DTD in order to display the document or can it display the document properly by just knowing the actual (X)HTML version stated in <!DOCTYPE>?

 

If the browser doesn't read the DTD, then why is it necessary to include a link to it in the <!DOCTYPE>-tag? :blink:

 

 

Thanks! :D

Share this post


Link to post
Share on other sites

Theoretically, DTDs tell mark-up readers what is the proper structure for an XML or SGML document.

 

In practise, the browser just chooses a rendering engine based on whether the DTD is a current standard or not. You should use one of the standard DTDs, there are eight of them which you can find here: http://w3schools.com/tags/tag_doctype.asp

 

If you don't use one of those DTDs, the browser will render your page using an old rendering engine which will cause it to look very different in different browsers.

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
Sign in to follow this  

×
×
  • Create New...