Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Why Firefox highlights HTML transitional doctype in red?

It looks like Firefox is treating it like an error. What does this mean?

enter image description here

Firefox treats it normally if I change it to:

<!DOCTYPE html>
<html>

BTW I'm on Firefox 12.0

like image 487
IMB Avatar asked May 27 '12 15:05

IMB


1 Answers

If you hover over that red line, Firefox gives you the answer.

Almost standards mode doctype. Expected “<!DOCTYPE html>”

The markup of the View Source also hints its an error doctype

<span class="error doctype" title="Almost standards mode doctype. Expected “<!DOCTYPE html>”.">
    &lt;!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"&gt;
</span> 

The point is, Firefox wants <!DOCTYPE html> as the standard mode doc-type.

Update:

Excerpt from the above given link.

The DOCTYPE shown in the example, <!DOCTYPE html>, is the simplest possible, and the one recommended by HTML5. Earlier versions of the HTML standard recommended other variants, but all existing browsers today will use full standards mode for this DOCTYPE, even the dated Internet Explorer 6. There are no valid reasons to use a more complicated DOCTYPE. If you do use another DOCTYPE, you may risk choosing one, which triggers almost standards mode or quirks mode.

like image 153
naveen Avatar answered Oct 23 '22 19:10

naveen