JavaScript EditorBest javascript editor debugger     Ajax website 



Main Page

Previous Page
Next Page

10. Formatting with Styles

As we saw in Chapter 4, Basic (X)HTML Formatting, (X)HTML has a rather limited repertoire of text formatting options. Thankfully, CSS offers many more possibilities.

With CSS, you can change the font face, size, weight, slant, line height, foreground and background color, spacing and alignment of text, decide whether it should be underlined, overlined, struck through, or blinking, and convert it to all uppercase, all lowercase, or small-caps. And you can apply those changes to an entire document or an entire site. In this chapter, you'll learn how.

Figure 10.1. Here is what the page looks like with no style sheet applied. You can find the source XHTML code in the Examples section of my site: http://www.cookwood.com/html6ed/examples/


I should probably also note that while many of the properties discussed in this chapter apply mostly to text, that doesn't mean they only work with text. Many of them work just fine on other kinds of content as well.

We'll continue on with CSS layout in Chapter 11, Layout with Styles.


Previous Page
Next Page


      Choosing a Font Family
      Specifying Alternate Fonts
      Creating Italics
      Applying Bold Formatting
      Setting the Font Size
      Setting the Line Height
      Setting All Font Values at Once
      Setting the Color
      Changing the Text's Background
      Controlling Spacing
      Adding Indents
      Setting White Space Properties
      Aligning Text
      Changing the Text Case
      Using Small Caps
      Decorating Text


JavaScript EditorBest javascript editor debugger     Ajax website