次の方法で共有


Choosing CSS Versions

Menu:  Tools -> Options -> Text Editor -> HTML -> Validation (HTML Schema)
Versions:  2008,2010
Published:  12/25/2010
Code:  vstipEdit0093

 

 

image

 

 

Dedicated Style Sheets

When working with Cascading Style Sheets you often find yourself working with specific versions.  When you create a CSS file in Visual Studio:

image

 

 

You can choose what version you want to use by selecting it from the "Cascading Style Sheet Version for Validation" dropdown list:

image

 

 

 

Embedded Styles

It is HIGHLY recommended that you use dedicated style sheets; however you may find that you want to embed styles in your HTML source:

image

 

 

When you do this it may not be clear how you select the CSS version here.  Well you don't exactly.  Apparently it's bound to the choice you make in the "Target Schema for Validation" dropdown list:

image

 

 

Here is how the CSS version relates to the choices:

HTML Schema CSS Schema
Internet Explorer 6.0 Internet Explorer 6.0
HTML 4.01 CSS 1.0
XHTML 1.0 Transitional CSS 2.0
XHTML 1.0 Frameset CSS 2.0
XHTML 1.1 CSS 2.1

 

 

 

 

Finally

So there are a lot of good reasons to use dedicated style sheets but if you do find yourself doing embedded CSS then make sure you understand which schema you are using based on your HTML schema choices.