Setting Up the HTML Code


The HTML code for this lesson that contains a single paragraph of text is shown in Listing 4.1.

Listing 4.1. HTML Code Containing the Markup for Lesson 4
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"          "http://www.w3.org/TR/html4/strict.dtd"> <html lang="en"> <head>     <meta http-equiv="content-type" content="text/html;     charset=utf-8">     <title>Lesson 4</title> </head> <body> <p>     Lorem ipsum dolor sit amet, consectetuer adipiscing     elit... </p> </body> </html> 

In this lesson, the <p> element will be styled with font-family, width, background-color, margin, and padding.

These styles can be applied to <p> elements using three methods: inline styles, header styles, and external style sheets. Although each method will be explained, external style sheets are the preferred option because they do not add CSS to the HTML markup.




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