Chapter 3. Designing Your Web Pages

WHAT YOU WILL LEARN IN THIS CHAPTER:

  • What CSS is and why you need it

  • How CSS looks and how to write it

  • The different ways to add CSS code to your ASP.NET pages and to external files

  • The numerous tools that VWD offers you to quickly write CSS

The pages you created in the previous two chapters look pretty plain and dull. That's because they lack styling information and therefore default to the standard layout that the browser applies. To spruce up your pages, you need a way to change their presentation in the browser. The most common way to do this is by using the Cascading Style Sheets (CSS) language. CSS is the de facto language for formatting and designing information on the Web, including ASP.NET web pages. With CSS you can quickly change the appearance of your web pages, giving them that great look that your design or corporate identity dictates.

Solid support for working with CSS has been added in VWD 2008, the previous version of Visual Web Developer. The new VWD 2010 builds on top of this CSS support and improves it in a number of ways, including the ability to render pages much closer to how they'll eventually end up in the browser. The CSS tools enable you to visually create your CSS code, making it much easier to style your pages without the need to know or remember every little detail of CSS.

To understand the relevance of and need for CSS in your ASP.NET web sites, you need to understand the shortcomings of HTML first. The next section looks ...

Get Beginning ASP.NET 4: in C# and VB 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.