需要 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,只是一点帮助,哦,一切都会好的”
<!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
在Facebook和Twitter上告诉您的朋友有关此帖子的信息
需要 doctype