Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Why is DOCTYPE line red in firefox?

The websites I've designed had no problem before but now I see DOCTYPE line red in Firefox 11. There is no problem in validation. I changed encoding to UTF-8 without BOM but problem still exists.

http://validator.w3.org/check?uri=genelvana.com

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
like image 354
HasanG Avatar asked Apr 07 '12 10:04

HasanG


3 Answers

Isn't it because Transitional doctype isn't really valid anymore unless you are using legacy code?

Surely now if you build a website now, should you be using strict or html5?

like image 135
David Blaine Avatar answered Nov 09 '22 06:11

David Blaine


Same here while Fx6 didn't color it in red.

While hovering this first line, a tooltip appears saying

Almost standards mode doctype. Expected "<!DOCTYPE html>".

You can safely forget this "advice" IMHO. The important thing to do is choosing a valid doctype and then write code that is conformant to this doctype, as you already do. No browser cares about what follows html so the contrary is true too: no browser cares if there's something after html ;)
Of course, if you use HTML5 elements and technologies (nav element, canvas or whatever) then yes use the HTML5 doctype.

like image 22
FelipeAls Avatar answered Nov 09 '22 05:11

FelipeAls


It's not so much an error, as it is a warning. Firefox is simply alerting you that the DOCTYPE you are using, XHTML 1.0 Transitional, triggers Almost standards mode, instead of Standards mode.
If you want the page to be displayed in Standards mode, all you need to do is change the DOCTYPE to either XHTML 1.0 Strict or HTML 5.

like image 27
Slartibartfast Avatar answered Nov 09 '22 04:11

Slartibartfast