Choosing CSS Versions
Menu: Tools -> Options -> Text Editor -> HTML -> Validation (HTML Schema)
Versions: 2008,2010
Published: 12/25/2010
Code: vstipEdit0093
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:
You can choose what version you want to use by selecting it from the "Cascading Style Sheet Version for Validation" dropdown list:
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:
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:
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.