Forum Moderators: open

Message Too Old, No Replies

Transitional vs Strict

         

Scooter24

8:44 am on Jul 19, 2009 (gmt 0)

10+ Year Member Top Contributors Of The Month



I'm not really an HTML expert so I use (Seamonkey) Composer as a reference when I need to generate some HTML code for my site.

Composer will generate the transitional doctype:
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">

Is there any benefit for switching to the strict doctype?

In case the HTML of my site does not validate as strict, I will have to correct it and for that I will need some WYSIWYG editor capable of generating strict HTML code. Is there any freeware software capable of that?

BTW, why does Composer (even the latest version) still generate transitional code?

mattur

10:53 am on Jul 19, 2009 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Your current doctype is a "half" doctype, so it triggers quirks mode [webmasterworld.com] display in browsers. See choosing the best doctype for your site [webmasterworld.com] for a good overview.

Scooter24

11:57 am on Jul 19, 2009 (gmt 0)

10+ Year Member Top Contributors Of The Month



Thanks for the links. I do in fact use tables for layout. Is that forbidden in HTML strict?

mattur

12:28 pm on Jul 19, 2009 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



No, HTML4.01 Strict does not forbid layout or data tables. It does forbid some presentational HTML like <center> and some presentational attributes like bgcolor, hspace, vspace etc. They still work in browsers, they just won't validate.

Because you're using tables for layout, the "full" Transitional doctype may be the best option, as it triggers almost standards mode [developer.mozilla.org] in Firefox - with one difference to the way images in tables [developer.mozilla.org] are displayed.

piatkow

3:06 pm on Jul 20, 2009 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



Remember that if you are using a wysiwyg editor then you may have to manually fix the code if you change the doctype from its default.