Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Strict or Transitional?

Tags:

html

Why should I use a "Strict" doctype vs "Transitional"? It seems like "Strict" is like it says, more strict. I seem to have a hard time getting things to work (css) properly vs using transitional.

like image 473
muncherelli Avatar asked Feb 03 '23 03:02

muncherelli


1 Answers

Transitional is, essentially, "Strict + things that should almost never be used".

So use Strict until you find yourself needing something that Transitional adds, and then think very hard about if you really need to use that element or attribute.

There should be no differences in the ways that browsers treat CSS when you switch between those Doctypes, unless you use the short form of the HTML 4.01 Transitional Doctype (i.e. without the URI) or are using HTML 4.0 (don't, it has no benefits over 4.01 at all).

like image 52
Quentin Avatar answered Feb 06 '23 15:02

Quentin