Jump to content

Recommended Posts

I have built a site with Expression Web4 and it generates DOCTYPE code.

 

I am starting to adopt HTML5/CSS3 and would like to deeply understand all that there is to know about "DOCTYPE"

 

I am concerned that the generated code (now very dated) will interfere with my site.

 

Yes, I am new to these topics.

 

 

 

Link to post
Share on other sites

The original purpose of the document type declaration was to tell the browser the rules that the document follows. In HTML, it doesn't serve that purpose anymore. The browser uses the doctype to determine which version of HTML is being used and how to render it.

 

An invalid doctype, an old doctype or no doctype at all will cause the page to render in quirks mode, which is the way browsers used to render pages over 10 years ago. This was for backwards compatibility on pages built with HTML 3.2 and older. Specifying a valid HTML 4.01, XHTML or HTML 5 doctype will make the browser render in standards compliant mode, in which browsers all render things the same way, theoretically.

 

It's important to build your pages in standards compliant mode. The page davej linked you to has a list of all valid doctype declarations. I would not recommend using HTML 4.01 or XHTML anymore, they're already getting old. Use HTML 5.

Link to post
Share on other sites

Going to HTML5 will still give backward compatibility for the most part, but when you validate, you will get errors and/orwarnings about depeciated, obsolete, or modified tags/attributes. Those can be corrected over time and converting the local obsolete attributes to CSS replacements will generally be transparent. You should get rid of the obsolete/depreciated attributes not just to make maintenance easier, but also for efficiancy. When a modrtn browser encounters an obsolete attribute, it has to execute extra code to convert it to CSS, as the older attributes are no longer understood by the rendering engines or the renderObjects that need to fire for paint operations.

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...
×
×
  • Create New...