Why is <body vlink="#006699"> still working in HTML5

9 posts

Flag Post

Documentation says that HTML5 does not support vlink, alink, bgcolor and other parameters, instead people should use CSS, but why is it still working fine? I’m declaring HTML5 doctype correctly:

<!DOCTYPE html>

Maybe my browser is not actually reading HTML5?

 
Flag Post

Your browser is lazy and is parsing those parameters anyway.

 
Flag Post

surprise, the browser maintains backwards compatibility with other versions of HTML. also, your doctype isn’t for HTML5

 
Flag Post
Originally posted by skyboy:

also, your doctype isn’t for HTML5

Actually, yes it is

 
Flag Post

Originally posted by Draco18s:

Actually, yes it is

so they chose a doctype that can be parsed like an unfinished HTML4 doctype, leaving the browser to parse the page as HTML4 quirks mode

 
Flag Post
Originally posted by skyboy:

Originally posted by Draco18s:

Actually, yes it is

so they chose a doctype that can be parsed like an unfinished HTML4 doctype, leaving the browser to parse the page as HTML4 quirks mode

Yep.

 
Flag Post

HTML5 can still parse HTML4 parameters, but they will not be displayed for you in auto-fill. Keep in mind that if HTML5 cannot find out what something is, it will fall back to previous versions of HTML to parse it. That doesn’t mean you should keep using it though.

vlink in HTML has been replaced with a:visited in CSS ( a:visited { color: red; } ).
alink in HTML has been removed. Use ( a { color: red; } ).
bgcolor has been replaced with background-color or fill.

 
Flag Post
Originally posted by skyboy:

Originally posted by Draco18s:

Actually, yes it is

so they chose a doctype that can be parsed like an unfinished HTML4 doctype, leaving the browser to parse the page as HTML4 quirks mode

Yeah – I like the idea of a simple doctype, but wouldn’t have

<!DOCTYPE html5>

have worked just as well? Maybe I’m just missing some train of thought, don’t know.

 
Flag Post

Thanks to everyone for info, it’s good to know even such a simple things.

In my opinion

<!DOCTYPE html5>

Would be better, but they probably have a reason for that. And it worked because html is so flexible you can write there anything and it will still work in most cases, sometimes I even feel bad on how liberal html is.