如何抑制Visual Studio 2008中的特定CSS 2.0验证错误? [英] How to suppress specific CSS 2.0 validation errors in Visual Studio 2008?
问题描述
我经常使用的典型CSS属性是 overflow-x
或 overflow-y
。有时我使用CSS 2.1或更高版本的属性或选择器。这些(正确)引发验证错误:
A typical CSS property that I use often is overflow-x
or overflow-y
. Sometimes I use CSS 2.1 or later properties or selectors. These (correctly) raise a validation error:
验证(CSS 2.0):'overflow-y'一个已知的CSS属性名称。
多年来我忽略了这一点,可以关闭特定行,块,文件或项目的C#和其他语言的警告。类似的可能的CSS(或HTML)错误或警告吗?
For years I ignored this, but it kinda feels wrong. It's possible to switch off warnings in C# and other languages for a particular line, block, file or project. Is something similar possible for CSS (or HTML) errors or warnings? Instead of switching it all off, I prefer a more granular solution.
推荐答案
如果你愿意偷偷摸摸一下,
If you're willing to muck around a bit you can get exactly what you want.
- 转到Visual Studio文件夹\Common7\Packages\1033\schemas\CSS
- 将css21.xml复制到css21mod.xml
-
查找部分:
- Go to Visual Studio folder \Common7\Packages\1033\schemas\CSS
- Copy css21.xml to css21mod.xml
Find the section:
<cssmd:property-def _locID="overflow" ...
在此部分后,插入:
After that section, insert:
<cssmd:property-def
_locID="overflow-x" _locAttrData="description,syntax"
type="enum"
description="Visibility of content extending beyond element's dimensions in x"
syntax="One of the overflow values | inherit"
enum="inherit auto hidden scroll visible"/>
<cssmd:property-def
_locID="overflow-y" _locAttrData="description,syntax" type="enum"
description="Visibility of content extending beyond element's dimensions in y"
syntax="One of the overflow values | inherit"
enum="inherit auto hidden scroll visible"/>
打开regedit,转到 HKEY_LOCAL_MACHINE\SOFTWARE\ Microsoft \VisualStudio\9.0\Packages\ {A764E895-518D-11d2-9A89-00C04F79EFC3} \Schemas
如果在64位,您必须前往 SOFTWARE\Wow6432Node\Microsoft
等
If on 64-bit, you will have to go to SOFTWARE\Wow6432Node\Microsoft
etc
新密钥 Schema 5
,并用 css21mod.xml
填写File和Friendly Name和 CSS 2.1(mod)
Create a new key called Schema 5
, and fill in the "File" and "Friendly Name" string values with css21mod.xml
and CSS 2.1 (mod)
!
这篇关于如何抑制Visual Studio 2008中的特定CSS 2.0验证错误?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!