为什么VS 2012 RC同时具有"DOCTYPE:HTML5"和"DOCTYPE:HTML5"和"HTML5"在网络工具栏中? [英] Why does VS 2012 RC have both "DOCTYPE: HTML5" and "HTML5" in the web toolbar?

查看:32
本文介绍了为什么VS 2012 RC同时具有"DOCTYPE:HTML5"和"DOCTYPE:HTML5"和"HTML5"在网络工具栏中?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我刚刚安装了VS 2012 RC,并且在HTML工具栏下拉菜单中具有以下两项:

I just installed VS 2012 RC and in the HTML toolbar dropdown it has both of the following:

  • DOCTYPE:HTML5
  • HTML5

两个HTML5选项之间有什么区别?我以为HTML5的建议不是指定DOCTYPE,所以第一个选项有点像您想要不含咖啡因的咖啡因吗?"

What's the difference between the two HTML5 options? I thought the recommendation for HTML5 was not to specify a DOCTYPE, so the first option is kinda like "would you like some caffeine with that decaf?"

注意:除非您正在编辑HTML页面,否则该工具栏将被禁用,并且不会用于任何形式的代码生成.工具栏的选择与验证您正在编辑的文件的内容有关(是整页,布局还是部分视图),我正在寻找确切地发现选择一个选项或选择一个选项之间的区别的方法.另一个.

Note: the toolbar is disabled unless you're editing an HTML page and is not used for code generation of any sort. The toolbar selection has something to do with validation of the contents of the file you're editing (be it a full page, layout or partial view), and I'm looking to find out exactly what the difference is between choosing one option or the other.

如果有任何答案都是基于实际知识,而不是猜测添加的"DOCTYPE:"前缀可能意味着什么,我也将不胜感激.

I'd also appreciate it if any answers were based on actual knowledge, rather than guesswork on what the added "DOCTYPE:" prefix could imply.

推荐答案

答案来自: https://stackoverflow.com/a/14944039/1145177

关于HTML5与DOCTYPE:HTML5问题,这是我在使用VS 2012 RTM时观察到的内容:

Regarding the HTML5 vs. DOCTYPE:HTML5 question, here's what I've observed while using VS 2012 RTM:

DOCTYPE:{值}选项告诉VS检查您的页面,并尝试从DOCTYPE和html标签中找出要应用的验证级别.例如,如果我创建一个开始如下的页面:

The DOCTYPE:{value} option tells VS to examine your page and attempt to figure out from the DOCTYPE and html tags what level of validation to apply. For example, if I create a page that begins as follows:

<!DOCTYPE html>
<html>
...

然后将DOCTYPE:{value}选项更改为DOCTYPE:HTML5.但是,如果我的页面是这样开始的:

then the DOCTYPE:{value} option becomes DOCTYPE: HTML5. If, however, my page starts like this:

<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
...

然后它变成DOCTYPE:XHTML5.

then it becomes DOCTYPE: XHTML5.

不具有DOCTYPE:前缀的选项将强制VS使用选定的验证级别,而不考虑页面的结构/内容可能暗示什么.

The options that don't have the DOCTYPE: prefix force VS to use the selected level of validation regardless of what the structure/content of your page might suggest.

这篇关于为什么VS 2012 RC同时具有"DOCTYPE:HTML5"和"DOCTYPE:HTML5"和"HTML5"在网络工具栏中?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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