Chapter 3Designing Your Web Pages


  • 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 external files
  • The numerous tools that VS offers you to quickly write CSS


You can find the code downloads for this chapter on the Download Code tab at The code is in the Chapter 3 folder.

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 was initially added in Visual Web Developer (VWD) 2008, one of the predecessors of VS Express 2013 for Web. VS 2012 included a brand new CSS editor with features similar to other languages, such as C# and VB. The CSS editor has been further enhanced in VS 2013.

To understand the relevance of and need for CSS in your ASP.NET websites, you need to understand the shortcomings ...

Get Beginning ASP.NET 4.5.1: in C# and VB now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.