I'm working on a HTML5 / CSS 3.0 / MVC 3 project in Visual Studio 2010. Every time I restar开发者_如何转开发t 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
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
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".
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.
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.
精彩评论