您在编写网页时使用哪种文档类型? [英] Which doctype do you use when writing webpages?

查看:72
本文介绍了您在编写网页时使用哪种文档类型?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我只是对Google,Yahoo和Stackoverflow中使用的文档类型感到好奇.

I am just curious about the doctype use in Google, Yahoo and Stackoverflow.

我发现上述3个站点使用HTML4.01 doctype:

And I find that the above 3 sites use HTML4.01 doctype:

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd" >

许多人说我们应该使用XHTML1.0 doctype,但是上述3个站点不这样做.你知道为什么吗?

Many people say that we should use XHTML1.0 doctype but the above 3 sites do not do so. Do you know why?

我还想知道编写网页时将使用哪种文档类型.

I would also like to know which doctype you'll use when writing webpages.

推荐答案

我使用 HTML5 doctype:

I use the HTML5 doctype:

<!DOCTYPE html>

因为XHTML不能在Web上运行,并且doctype本质上仅是触发标准布局模式的好方法,上述构造在每种浏览器中都能很好地发挥作用.

Because XHTML does not work on the web and doctype is essentially only good to trigger the standards layout mode, which the above construct does very well in every browser.

这篇关于您在编写网页时使用哪种文档类型?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆