Make CSS 3.0 the Default in Visual Studio 2010 SP1 Web Update

你。 提交于 2019-12-30 05:43:09

问题


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


回答1:


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




回答2:


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".




回答3:


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.




回答4:


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.



来源:https://stackoverflow.com/questions/7323657/make-css-3-0-the-default-in-visual-studio-2010-sp1-web-update

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!