17

I'm working on a HTML5 / CSS 3.0 / MVC 3 project in Visual Studio 2010. Every time I restart VS and then open a CSS file, it's always set to 'CSS 2.1'. Is there a way to tell VS I want to use CSS 3.0 always (or at least by default)?

BTW, I have looked under "Tools>Options>Text Editor>HTML" - no CSS options, default is HTML5. I have also looked under "Tools>Options>Text Editor>CSS" - no version option as far as I can see.

Thanks, Michael

Michael Kennedy
  • 3,202
  • 2
  • 25
  • 34

4 Answers4

15

I had a similar problem after SP1.
I had to specifically install the "CSS 3 Intellisense Schema" found here -->

http://visualstudiogallery.msdn.microsoft.com/7211bcac-091b-4a32-be2d-e797be0db210

Restart VS and it started remembering what I had set last. HTH

davehale23
  • 4,374
  • 2
  • 27
  • 40
  • Thank you. That is helpful and that's the CSS 3 I'm referring to. But what I really want (my question was) to make CSS 3 selected every time I open a CSS file rather than having the 2.1 selected and then having to toggle the dropdown which is making me crazy. :) – Michael Kennedy Nov 02 '11 at 23:21
  • Perhaps I should not have 'sum-up', let me explain. After I installed SP1, I was having the same problem as you. --> CSS3 would not stay defaulted on when I restarted VS2010. It would always select CSS 2.1 when I first opened VS. Then I specifically installed the package I mentioned, and magically it would remember what I had selected last. I just write this to clarify, not to be pedantic. :) – davehale23 Nov 04 '11 at 15:11
  • Awesome! I re-installed this version (which I guess was updated) now it sticks. Thank you. – Michael Kennedy Nov 04 '11 at 18:15
8

The default CSS schema is defined by the selected HTML schema, but there is no UI to change the CSS schema targeted by the HTML schema. You will have to do it manually by editing the appropriate HTML schema.

To have HTML 5 target CSS 3.0, edit

"\Microsoft Visual Studio 10.0\Common7\Packages\schemas\html\html_5.xsd"

and change vs:cssschema to "CSS 3.0".

Jeff Shepler
  • 2,007
  • 2
  • 22
  • 22
  • Awesome thanks! There is a new fix BTW available now. VS 11 supports this and more directly, so that helps if you can use VS 11... – Michael Kennedy May 25 '12 at 20:57
2

Installing:

Web Standards Update for Microsoft Visual Studio 2010 SP1

also makes VS remember CSS 3.0 validation setting.

Web Standards Update provides the much wanted HTML5 & CSS3 support to Visual Studio 2010 SP1. It brings VS 2010 intellisense & validation as close to W3C specification as we could get via means of an extension. The most notable supported features by this extension are:

HTML5 – Video, Audio, Input Type, Drag & Drop, WAI-ARIA, Microdata, Schema.org Browser API – GeoLocation & Local Storage CSS3 – 2D Transforms, 3D Transforms, Animations, Background & Borders, Basic Box Model, Basic UI, Behavior, Color, Flexible Box Layout, Fonts, Paged Media, Hyperlink Presentation, Line, Lists, Marquee, Media Queries, Multi Column, Namespaces, Presentation Levels, Ruby, Selectors, Speech, Syntax, Template Layout, Text & Transitions. It also supports vendor specific prefixes like –ms, -webkit & -moz.

Răzvan Flavius Panda
  • 21,730
  • 17
  • 111
  • 169
2

Download the latest Visual Studio 2010 update at http://visualstudiogallery.msdn.microsoft.com/a15c3ce9-f58f-42b7-8668-53f6cdc2cd83

"Web Standards Update for Microsoft Visual Studio 2010 SP1" adds CSS3 support and updates the HTML5 intellisense and validation including new JavaScript API's

Installation Notes: Don't install this update if you have installed your visual studio to a different directory instead of the default directory.

Max
  • 4,965
  • 17
  • 49
  • 64