开发者

How do you enable error detection for CSS files in Visual Studio 2010?

How do you enable error dectection for CSS files in Visual Studio 2010? It's said to be in tools o开发者_运维知识库ptions, but I can't seem to find it.


  1. In Visual Studio, open the Tools menu and select Options
  2. Expand the Text Editor group, then the CSS group.
  3. Click on Miscellaneous and you'll see the option to enable Detect Errors there.


Make sure in Visual Studio 2010 IDE> View>Toolbars>Stylesheet is checked to show Stylesheet toolbar.

How do you enable error detection for CSS files in Visual Studio 2010?

IDE will indicate errors in two ways.

01) most importantly don't forget VS Error List window.It will show css errors in warnings section.you can then navigate to error by double clicking the error itself through the window.

How do you enable error detection for CSS files in Visual Studio 2010?

02) it will show squiglies in erroneous CSS styles


Not sure if this is what you're asking for, but Visual Studio comes with a few CSS validation templates. If you select from the top menu View > Toolbars > Style Sheet, you'll see a little dropdown in the top toolbar. My VS 2010 lets me choose "Internet Explorer 6.0, CSS 1.0, CSS 2.0 and CSS 2.1"

If you write a property that's not valid for the currently selected CSS version, Visual Studio will put a little green line underneath it and complain about it not being a known CSS property etc.


This happened to me and CTRL+K+D gave me that same error even when detection was on. The solution was to look in the 'Errors' tab in Studio and to look at just the warnings. Scroll down to the CSS file related issues and low and behold your syntax error will be listed there.

Mine turned out to be two semi-colons ';;'

Hope this helps anyone else :)

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜