HTML and CSS Reference
In-Depth Information
HANDS-ON PRACTICE 2.3
Open your heading.html file in a text editor. Use the following sample code and add a
paragraph of text to your page below the line with the <h1> tags and above the line
with the <h2> tags. Save your page as heading2.html.
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"
<html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en">
<head>
<title>Sample Heading Tags</title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
</head>
<body>
<h1>Heading Level 1</h1>
<p>This is a sample paragraph about HTML and XHTML. XHTML is the
newest version of HTML. XHTML uses the tags and attributes of HTML
along with the syntax of XML.</p>
<h2>Heading Level 2</h2>
<h3>Heading Level 3</h3>
<h4>Heading Level 4</h4>
<h5>Heading Level 5</h5>
<h6>Heading Level 6</h6>
</body>
</html>
Launch a browser to test your page. It should look similar to the page shown in Figure
2.6 and to the solution in the student files (Chapter2/heading2.html).
Figure 2.6
Web page using
headings and a
paragraph
Notice how the text wraps automatically as you resize your browser window. If you
wanted to have the second sentence in the paragraph begin on its own line, you would
need to add a line break.
 
Search WWH ::




Custom Search