Advantages of HTML Strict over Transitional

S

Sally Thompson

The subject says it all really. I've been writing my pages in HTML
4.01 Transitional, but I've seen a few references to the desirability
of writing new pages in HTML Strict. I just wondered what the
advantages - or disadvantages - would be of doing that? I've been
reading up a bit on what the differences are, and for instance on
<http://www.upsdell.com/BrowserNews/res_doctype.htm> it suggests
using:
HTML 4.01:
Strict: when browsers that are CSS-deficient need not be supported.
Transitional: when browsers that are CSS-deficient must be supported.

Well, I don't know what to support! I'm gradually trying to make my
pages readable in as many as possible!

Also, if I do go over to Strict, is there a good chart somewhere that
will list the differences (you know, if you have used <abc> in
Transitional, you will need to change it to <xyz> in Strict).

Apologies if this has been asked before, but I certainly haven't seen
it recently.
 
N

Neal

The subject says it all really. I've been writing my pages in HTML
4.01 Transitional, but I've seen a few references to the desirability
of writing new pages in HTML Strict. I just wondered what the
advantages - or disadvantages - would be of doing that? I've been
reading up a bit on what the differences are, and for instance on
<http://www.upsdell.com/BrowserNews/res_doctype.htm> it suggests
using:
HTML 4.01:
Strict: when browsers that are CSS-deficient need not be supported.
Transitional: when browsers that are CSS-deficient must be supported.

Well, I don't know what to support! I'm gradually trying to make my
pages readable in as many as possible!

Most browsers are either CSS supporting or don't do CSS or presentational
HTML at all anyway. You're best off serving the few remaining browsers
(mainly NN4) a document which imports CSS in such a way that they won't
mangle the page when rendering. CSS is richer than presentational HTML, so
using the deprecated elements and attributes is limiting.
Also, if I do go over to Strict, is there a good chart somewhere that
will list the differences (you know, if you have used <abc> in
Transitional, you will need to change it to <xyz> in Strict).

http://www.w3.org/TR/html4/index/elements.html and
http://www.w3.org/TR/html4/index/attributes.html fit the bill.
Apologies if this has been asked before, but I certainly haven't seen
it recently.

Another point to consider - the strict DTD invokes the least quirky
rendering mode in IE. Your webpage will render more uniformly across
browsers with a strict definition.
 
B

Barry Pearson

Sally said:
The subject says it all really. I've been writing my pages in HTML
4.01 Transitional, but I've seen a few references to the desirability
of writing new pages in HTML Strict. I just wondered what the
advantages - or disadvantages - would be of doing that? I've been
reading up a bit on what the differences are, and for instance on
<http://www.upsdell.com/BrowserNews/res_doctype.htm> it suggests
using:
HTML 4.01:
Strict: when browsers that are CSS-deficient need not be supported.
Transitional: when browsers that are CSS-deficient must be supported.

Well, I don't know what to support! I'm gradually trying to make my
pages readable in as many as possible!

My current target is validated 4.01 Strict for all my new pages. And I hope to
convert all my existing Transitional pages to Strict within months. But .... I
have little expectation that this will increase the readability of my pages
world-wide. Perhaps by a few %, but that is at best. Perhaps not at all. Some
research in 2001 suggested that less than 1% of pages validated at all! The
proportion of pages on the web that are Strict must surely be vastly smaller
than this. We live in a world where user agents don't appear to care much
about validation, and certainly not about Strict.

So why do I bother? I am doing so to improve my personal workflow. I believe
that developing to Strict will be the most cost-effective approach over time.
Make up your own mind whether these advantages apply to you:

- I only need to know a tight subset of the totality of HTML. Strict HTML is a
pretty simple language.

- I don't need to know how HTML presentation attributes interact with CSS. I
use the CSS version. It makes life simple!

- I build a repository of re-usable assets with every project I work on. For
the next web site, I may have (say) 100 or more re-usable CSS rules as a
starter kit, that I can then modify if I need to.

- I believe there are more experts willing to help solve a problem of someone
who uses Strict. You don't get an initial "sort out your HTML" response! Quite
right.

- I can copy / borrow / steal stuff from the world's experts, who typically
also use Strict. (I have no pride - I'll copy from anyone to make the current
project work).
Also, if I do go over to Strict, is there a good chart somewhere that
will list the differences (you know, if you have used <abc> in
Transitional, you will need to change it to <xyz> in Strict).
[snip]

Two very useful pages, to help you know what is Strict v Transitional. (Avoid
"deprecated" & "loose" if you can).
http://www.w3.org/TR/html401/index/attributes.html
http://www.w3.org/TR/html401/index/elements.html

They don't always tell you what to do. (Eg. "use float left instead of align
left"). But people here will be very helpful towards authors trying to become
Strict. It is considered to be "a good thing".

I editted those pages above to focus on what I needed to correct. Then I am
attacking those areas one at a time. My remaining problems are mainly "width
attributes in <td>", and "align attributes". Then, bingo! 100% Strict.
 
B

Barry Pearson

Toby A Inkster wrote:
['snip]
And an advantage: The strict DTD enforces a more rigorous approach to
writing HTML. And the more rigour you put into things, the better they
(usually) turn out.

Have you evidence for that?

(I am speaking as someone whose target for new pages is validated 4.01
Strict).
 
N

Neal

Toby A Inkster wrote:
['snip]
And an advantage: The strict DTD enforces a more rigorous approach to
writing HTML. And the more rigour you put into things, the better they
(usually) turn out.

Have you evidence for that?

(I am speaking as someone whose target for new pages is validated 4.01
Strict).

I think it's common sense. The less markup you are able to use, the less
likely you'll screw up the markup. Those who know to use Strict are likely
to validate the code. It also means using CSS which lightens the pages,
and often helps make markup more semantically structured.

Although, I might be saying that the more rigorous coders use a Strict
DTD, after all :) Chicken and egg...
 
B

Barry Pearson

Neal said:
Toby A Inkster wrote:
['snip]
And an advantage: The strict DTD enforces a more rigorous approach
to writing HTML. And the more rigour you put into things, the
better they (usually) turn out.

Have you evidence for that?

(I am speaking as someone whose target for new pages is validated
4.01 Strict).

I think it's common sense. The less markup you are able to use, the
less likely you'll screw up the markup. Those who know to use Strict
are likely to validate the code. It also means using CSS which
lightens the pages, and often helps make markup more semantically
structured.

Although, I might be saying that the more rigorous coders use a Strict
DTD, after all :) Chicken and egg...

Chuckle! I was trying to unbundle various different arguments. Which is cause,
and which is effect?

I suspect that "intent to write quality code" (for whatever reason) is the
cause, and "use of Strict DTD" and "rigorous approach" and "validate" are the
effects. They are some "means" to help achieve the aim of quality code.
 
A

Andy Dingley

Toby A Inkster said:
The strict DTD enforces a more rigorous approach to writing HTML.

No it doesn't. All it does is to reduce the number of elements and
attributes that are permitted. "Rigour" is a measure of the accuracy
to which you comply with these limits and the general well-formedness
limits.

There's also the question of including </p> or not. This is not a
HTML rigour question at all, as owing to HTML's SGML roots, such
things are entirely optional in most cases. A future manual conversion
to XML though is made much easier if they went in when and where
they'll be needed.
 
D

DU

Sally said:
The subject says it all really. I've been writing my pages in HTML
4.01 Transitional, but I've seen a few references to the desirability
of writing new pages in HTML Strict. I just wondered what the
advantages - or disadvantages - would be of doing that? I've been
reading up a bit on what the differences are, and for instance on
<http://www.upsdell.com/BrowserNews/res_doctype.htm> it suggests
using:
HTML 4.01:
Strict: when browsers that are CSS-deficient need not be supported.
Transitional: when browsers that are CSS-deficient must be supported.

Well, I don't know what to support! I'm gradually trying to make my
pages readable in as many as possible!

Also, if I do go over to Strict, is there a good chart somewhere that
will list the differences (you know, if you have used <abc> in
Transitional, you will need to change it to <xyz> in Strict).

Apologies if this has been asked before, but I certainly haven't seen
it recently.

Thank you for chosing a meaningful, descriptive, self-explanatory
subject line. Yes, we most likely had discussions before on this
question but often subject are poorly worded or discussions switch to
other not-really-related issues. Chosing a meaningful, self-descriptive
subject line helps people searching through newsgroup archives.

I think the most important issue is to trigger MSIE 6 (the most
frequently used browser on the web right now) into standards compliant
rendering mode. Strict definition of HTMl 4.01 does that consistently on
all known browsers supporting triggering of rendering mode.

Important documents to answer you more in details:

1- Mozilla differences between the strict and quirks modes:
Mozilla Quirks Mode Behavior
http://www.mozilla.org/docs/web-developer/quirks/quirklist.html

2- The Opera 7 DOCTYPE Switches
"
Authoring error corrections
The two modes are unlikely to cause problems. As long as you avoid
making these errors, there won't be any difference in either mode, or
with any browser.
"
http://www.opera.com/docs/specs/doctype/

Opera 7 even has a user pref which can force strict standards rendering
mode regardless of doctype: I think this is unique in modern browsers.

3- Fix the Box Instead of Thinking Outside It
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dnie60/html/cssenhancements.asp

IMO, it's very important to support standards compliant rendering mode
in MSIE 6 because you greatly reduce the number of incompatibilities and
layout rendering issues. One very important gain thanks to this
rendering mode is that the CSS1 box model bug/incompatibilities are
fixed in MSIE 6 thanks to that compliant standards mode.

One obvious gain from using strict over transitional is that you are
future-proof, forward compatible as you're not using deprecated elements
and deprecated attributes. In strict mode, browsers tend to render some
elements in the same way: I think it is more because they trigger
standards compliant rendering mode than anything else... but there could
be subtilities here... I have a few examples in mind on this.

DU
 
S

Sally Thompson

I think the most important issue is to trigger MSIE 6 (the most
frequently used browser on the web right now) into standards compliant
rendering mode. Strict definition of HTMl 4.01 does that consistently on
all known browsers supporting triggering of rendering mode.
IMO, it's very important to support standards compliant rendering mode
in MSIE 6 because you greatly reduce the number of incompatibilities and
layout rendering issues. One very important gain thanks to this
rendering mode is that the CSS1 box model bug/incompatibilities are
fixed in MSIE 6 thanks to that compliant standards mode.

One obvious gain from using strict over transitional is that you are
future-proof, forward compatible as you're not using deprecated elements
and deprecated attributes. In strict mode, browsers tend to render some
elements in the same way: I think it is more because they trigger
standards compliant rendering mode than anything else... but there could
be subtilities here... I have a few examples in mind on this.

Thanks for the links (snipped for brevity) and the very useful advice,
DU, especially the last paragraph above. I like to know not just the
<how?>, but the <why?>.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,755
Messages
2,569,535
Members
45,007
Latest member
obedient dusk

Latest Threads

Top