需要 doctype_只需要一个DOCTYPE

需要 doctype

需要 doctype

At a lunch conversation about quirks vs standards mode, the question was raised: but what if you don't have those kinda important tags such as <html> or <body>? is this going to be quirks mode?

在关于怪异与标准模式的午餐会上,有人提出了一个问题:但是,如果您没有诸如<html>或<body>这样的重要标签怎么办? 这将是怪癖模式吗?

Well, the following test case shows that a DOCTYPE is all it takes in order to have standards mode rendering. Was this a Cinderella song: "We all need a little DOCTYPE, just a little helper, ooh and it will be alright" 🙂

好了,下面的测试用例说明了DOCTYPE就是为了具有标准模式呈现而要做的全部工作。 这是灰姑娘的歌吗:“我们都需要一点DOCTYPE,只是一点帮助,哦,一切都会好的”

» Run test example

»运行测试示例

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
 
 
hello
 
<script type="text/javascript">
alert("Quirks? " + document.compatMode);
</script>

Tell your friends about this post on Facebook and Twitter

FacebookTwitter上告诉您的朋友有关此帖子的信息

翻译自: https://www.phpied.com/a-doctype-is-all-it-takes/

需要 doctype

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值