Chapter 2. CSS Basics


CSS lets you control your document's appearancefonts, text, colors, backgrounds, sizes, borders, spacing, positioning, visual effects, tables, and lists. However, the real advantage of using CSS instead of HTML is that by changing a few lines of code, you can change the appearance of every page on your Web site.

With savvy use of CSS, you can take a plain page of text (Figure 2.1) and add visual design and interaction that turns it into a webbed environment (Figure 2.2).

Figure 2.1. Here's an HTML page displayed without the benefit of CSS. The page still displays, but without the formatting of Figure 2.2.


Figure 2.2. An HTML page using CSS to add an image in the background, position the content down and to the right, and format the text.


In this chapter, you'll learn the basics of how to apply styles to HTML tags, Web pages, and entire sites. You'll also learn the following:

  • Ways to define different selectors for different purposes

  • How to use pseudo-classes and pseudo-elements to control different parts or aspects of an element

  • How to create styles for more than just the computer screen

  • Ways to exploit real-world strategies for getting the best results for your designs




CSS, DHTML and Ajax. Visual QuickStart Guide
CSS, DHTML, and Ajax, Fourth Edition
ISBN: 032144325X
EAN: 2147483647
Year: 2006
Pages: 230

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net