写在前面:
前两天Cosmo同学跑来说淘宝的doctype改得好简单啊,赶紧瞄一眼,果然——
<!DOCTYPE html>
上网查了一下,才知道,这是HTML5的标准doctype写法。膜拜一下,HTML5已经悄悄走进了。
来看看Mozilla关于这种doctype写法的介绍:
原文:https://developer.mozilla.org/en/HTML/Introduction_to_HTML5
The doctype for HTML5 is very simple. To indicate that your HTML content should be interpreted as HTML5, simply use:
1 | <!DOCTYPE html> |
This very simple doctype will cause even browsers that don’t presently support HTML5 to enter into standards mode, which means they’ll interpret the long-established parts of HTML in an HTML5-compliant way while ignoring the new features of HTML5 they don’t support.
HTML5的doctype非常简单,只要使用<!DOCTYPE html>来标示HTML的doctype头,网页就能以HTML5的形式来解释网页内容了。这段非常简单的doctype甚至可以被现下并不全面支持HTML5的浏览器所支持。这些浏览器会忽略一些不支持的新属性,而将网页解释为HTML5的标准模式。
哪些网站已经采用了HTML5 doctype?
taobao.com的首页
jquery.com的event页面
youtube.com
……
小疑问:
<!DOCTYPE html>能被所有浏览器支持吗?
基本上所有的浏览器都支持这种doctype,但是浏览器并不全面支持HTML5的新属性,浏览器仍然会将这种doctype解释为标准模式,基本上可以认为是向下兼容的。


4条评论
那是不是说以后可以用这个dtd了
Keep posting stuff like this i really like it
Helpful summary, saved your site in interest to read more!
Excellent summary, saved the blog with interest to see more information!