简体   繁体   English

是否有可能阻止Visual Studio 2008无法构建CSS错误?

[英]Is it possible to stop Visual Studio 2008 from failing to build on CSS errors?

I have an external stylesheet that has specific IE-hacks. 我有一个具有特定IE浏览器的外部样式表。 Every so often my site will fail to build due to these hacks (it is the hash-hack; for example #margin-top:-2px; ). 由于这些黑客,我的网站经常无法构建(这是哈希黑客;例如#margin-top:-2px; )。 This is the error: 这是错误:

Unexpected character sequence. 意外的字符序列。 Expected a property name for the " : " declaration 期望“:”声明的属性名称

I haven't found out a concrete way to get the errors to stop, VS2008 just seems to stop caring after a while. 我还没有找到一个让错误停止的具体方法,VS2008似乎暂时停止了关怀。 I found this article , but I am unsure of how to edit the files properly so this "error" (since it is legal syntax) will not pop up again. 我发现这篇文章 ,但我不确定如何正确编辑文件,因此这个“错误”(因为它是合法的语法)不会再次弹出。

I'm not sure about 2008, but in 2005 (IIRC), you can go to: 我不确定2008年,但在2005年(IIRC),你可以去:

 Tools | Options | Text Editor | CSS | CSS Specific 

and then untick Detect Errors 然后解开检测错误

I remember having exactly the same problem on 100% valid CSS which MS didn't recognise (big shock), flicked this switch and forgot about the problem forever more. 我记得在MS无法识别的100%有效CSS上遇到了完全相同的问题(大震动),轻弹这个开关并永远忘记了问题。

Tools | 工具| Options | 选项| Text Editor | 文字编辑器| HTML | HTML | Validation 验证

Make sure 'Show Errors' 'As Warnings' is checked. 确保选中“显示错误”'作为警告'。 There was a bug early on that even if it was checked, it wasn't acknowledged, in which case, uncheck it and save the settings, then go back and check it again. 早期有一个错误,即使它被检查,它也没有被确认,在这种情况下,取消选中并保存设置,然后返回并再次检查。

最简单的方法是在编辑器中关闭文件,它应该停止抱怨。

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

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