8.8 Editing CSS in Visual Studio with the CSS Properties Window

Cascading Style Sheets have become the preferred method of controlling the style of web applications. Using CSS, you can create various stylesheets that you can then dynamically apply to your site, quickly and easily changing its look and behavior. CSS is also critical to supporting well-behaved sites viewed on nonstandard media, such as mobile devices or devices supporting disabled users.

Tip

CSS Zen Garden (http://www.csszengarden.com) is a great site on the benefits and power of CSS. CSS Zen Garden contains a wealth of CSS information and examples, all centered around a large number of styles applied to the same content, enabling you to see the vast range of things that can be accomplished with CSS.

Visual Studio has never made it easy to use CSS correctly. The default style dialogs let you only specify inline styles, which are stored directly with the individual HTML elements. While this is better than using deprecated HTML styling, you miss out on the main benefits of CSS, such as style consistency and reusability. To get the most out of CSS you need styles that can be used throughout your application, not just on individual elements.

The CSS Properties Window add-in for Visual Studio helps you write better CSS by giving you an easy-to-use interface for editing both the inline style properties and the properties of any inherited styles. This means you can quickly and easily modify styles wherever they are stored.

Get Windows Developer Power Tools now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.