I have a web project targeting .NET Framework 2 under Visual Studio 2010.
The Master Page is defined as:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
The CSS file is named Master.css.
Attributes such as overflow-y: scroll; appear highlighted in warnings as unknown property names. The validation rules being applied are CSS 2.1.
Is there a way to declare which version of CSS my code should be validated against? Also, when this code eventually runs on a browser, is there a way to force rendering using a specific CSS version?
Please bear with me as I am not aware of the relationship (if any) between the doctype of the HTML page and CSS validation.
CSS doesn’t “do” versions – that is, you can’t identify your CSS as a certain version.
Of course, there are different versions, but that is more for keeping track of which browsers support how much of the standard than for tagging what kind of CSS authors use.
That said, Visual Studio has a Stylesheet toolbar, where you can choose the version to check against.
Edit: oh, and no, the HTML Doctype doesn’t have anything to do with the CSS.