简体   繁体   English

编译时Visual Studio中的CSS样式错误

[英]CSS style errors in Visual Studio while compiling

Whenever I use CSS3 style commands (like Box-shadow, Box-Sizing, background gradient,etc ) in my Visual Studio 2010 projects and compiles it, VS shows one or more errors regarding CSS3 styles. 每当我在Visual Studio 2010项目中使用CSS3样式命令(如Box-shadow,Box-Sizing,背景渐变等)并编译它时,VS会显示一个或多个有关CSS3样式的错误。 How can I overcome this behavior of Visual Studio? 我怎样才能克服Visual Studio的这种行为?

You can turn off CSS validation errors in Visual Studio from Tools menu. 您可以从“工具”菜单中关闭Visual Studio中的CSS验证错误。 Select Tools > Options and perform the action shown in the following image. 选择工具>选项,然后执行下图中显示的操作。

在此输入图像描述

I have a better answer for you than the currently accepted answer. 对于你,我有一个比目前接受的答案更好的答案。 It's actually just a small change to said answer and here it is. 它实际上只是对所述答案的一个小改动,而且就在这里。 Just check the "as warnings" box. 只需选中“as warnings”框即可。 So it doesn't show up as an error (which is good because it ain't one), but it does show up in your pleasantly-ignorable warnings list still. 因此它不会显示为错误(这是好的,因为它不是一个错误),但它确实会出现在您的令人愉快的警告列表中。

在此输入图像描述

Up the top there is drop down text box (next to comments in toolbar). 在顶部有下拉文本框(工具栏中的注释旁边)。 Open that and see if you have HTML5/CSS3 in there. 打开它,看看你是否有HTML5 / CSS3。 If not, you have to download it from MSDN. 如果没有,您必须从MSDN下载它。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM