2

I validate CSS in my new projects against CSS 3.0, thanks to the solution here:

VS2010, HTML 5 and CSS 3 Validation

However, every time I load the project, CSS validation reverts to 2.1 and has to be set through the toolbar to validate against 3.0 again.

Is there a way to make my selection sticky?

Community
  • 1
  • 1
Eric J.
  • 147,927
  • 63
  • 340
  • 553

2 Answers2

1

You can set it in Options -> Text Editor -> CSS Validation. I have taken the screenshot from VS2012. It is same in VS2010.

enter image description here

Abhijeet
  • 13,562
  • 26
  • 94
  • 175
  • As a side Note, you will need VS2010 SP1 to use CSS 3 validation. Since you have been validating against, CSS 3. That means you already have it. :-) – Abhijeet Sep 23 '12 at 21:09
  • I have 2010 Pro SP1 and I do not see this option, however I do see a Miscellaneous item, but that does not contain validation options. – sprocket12 Feb 04 '13 at 10:29
1

First, shut down VS2010

Assuming you're validating against html5 - the validation option is in

Text Editor-->HTML-->Validation

Set it to HTML5 validation. Then verify the following file exists:

< your install directory >\Microsoft Visual Studio 10.0\Common7\Packages\schemas\html\html_5.xsd

Copy the file elsewhere to be safe then edit the original file using a text editor. Near the top of the file find the string:

vs:cssschema="CSS 2.1"

and change it to:

vs:cssschema="CSS 3.0"

if it isn't already. Then save the file and restart VS2010. That should take care of making CSS 3.0 validation sticky against html5 projects

fnostro
  • 4,531
  • 1
  • 15
  • 23