Styling the First Paragraph


The first paragraph in this example will use different fonts than the other paragraphs. In this case, it will be styled with times, "times new roman", serif. Fonts such as Times New Roman, which have spaces in their names, should always be wrapped in quotation marks.

The next step is to style the text italic and bold. This is achieved using font-style: italic; and font-weight: bold;.

To align the text in the center of the screen, use text-align: center.

The font size can be increased using font-size: 110%; and the font color can be set using color: #900; as shown in Listing 7.5 (see Figure 7.4).

Listing 7.5. CSS Code Containing Styles for the First Paragraph
p {     font-family: arial, helvetica, sans-serif;     font-size: 80%;     line-height: 1.4; } p.introduction {     font-family: times, "times new roman", serif;     font-style: italic;     font-weight: bold;     text-align: center;     font-size: 110%;     color: #900; } 

Figure 7.4. Screenshot of styled first paragraph.





Sams Teach Yourself CSS in 10 Minutes
Sams Teach Yourself CSS in 10 Minutes
ISBN: 0672327457
EAN: 2147483647
Year: 2005
Pages: 234
Authors: Russ Weakley

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