DOCTYPE

User 496680 Photo


Registered User
4 posts

I have been looking on line to understand the difference between transitional and strict. Just TMI. Can someone please provide just a short summary.

Thanks
User 355448 Photo


Ambassador
3,144 posts

Kevin,

Here is a list of what is allowed with which DOCTYPE. http://www.w3schools.com/tags/default.asp

Basically if you are not using frames, and you use up-to-date coding (not depreciated) then you can use strict. Otherwise, you need to use frame or transitional DOCTYPEs.

If you are using strict and it validates, then you code should be good for many years. If you are using depreciated code there is no assurance that browsers will continue to support that code.
User 496680 Photo


Registered User
4 posts

Bill -

Thank you.

Kevin
User 117361 Photo


Ambassador
6,076 posts

Kevin - I might just add that it is worth checking the validation of your code anyway - I find Firefox web developer addon very good for this - and even if you are using the transitional doctype, it is good practice to clean up your code if you find some deprecated elements
Here is just one example
http://www.w3.org/TR/html401/present/graphics.html of various deprecated elements.

Try out the US 508 Standards validation too, and of course, the css validation. Getting used to using cleaner compliant code will stand you in good stead for the future levels of compliancy I feel.
User 1998534 Photo


Registered User
11 posts

This is very helpful. Just a little more clarification. W3schools just states "Use the transitional DOCTYPE when you want to still use HTML's presentational features."

This makes it sound like if I use Strict, I'm loosing some HTML features. But I search for html presentation features and it only comes back with the same page.

I have no concerns about earlier code compatibility, everything is new using the latest HTML Editor.

Am I reading that wrong or doe 'strict' limit some HTML 'presentation features'?
Thanks
Larry
User 463058 Photo


Ambassador
1,073 posts

"HTML's presentational features" refers to the deprecated tags and attributes which were used to control the appearance of things prior to the introduction of CSS. So, you shouldn't use the <font> tag or bgcolor attribute, for instance, with strict.
User 1998534 Photo


Registered User
11 posts

Cary wrote:
"HTML's presentational features" refers to the deprecated tags and attributes which were used to control the appearance of things prior to the introduction of CSS. So, you shouldn't use the <font> tag or bgcolor attribute, for instance, with strict.


Aha! Perfect. I'm lovin learning CSS, so 'Strict' is the way to go for me.
Thanks you so much for your time.
Larry

Have something to add? We’d love to hear it!
You must have an account to participate. Please Sign In Here, then join the conversation.