HTML and CSS Reference
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"
<html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en">
<title>Sample Heading Tags</title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
<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>
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).
Web page using
headings and a
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.