HTML and CSS Reference
In-Depth Information
CHECKPOINT 2.1
1. Describe the origin, purpose, and features of HTML.
2. Explain why you would use XHTML instead of HTML.
3. Describe the purpose of the header and body sections of a Web page.
2.5 XHTML—Body and Text Basics
Have you noticed the wide variety of page designs on Web sites? Whether a Web page
contains mostly text, uses blocks of color, displays images, employs animation, or is
interactive, the foundation of the page is the <body> tag.
The Body Element
The purpose of the <body> element is to contain the text and XHTML elements that
will display in the browser window. As you noticed when you created your first Web
page, any text that you type in the body section of a Web page document will be dis-
played by the browser in the actual Web page. Often, this text is organized by structural
elements that indicate important headings, text paragraphs, and lists. These structural
elements are block-level elements —they control blocks of text such as headings, para-
graphs, and lists. Tags that affect individual sections of text are called inline-level ele-
ments . Web development is a skill—the more you practice, the better you get. Why not
try each example as you read?
The Heading Element
Headings are block-level elements that are organized into levels h1 through h6. The size
of the text is largest for <h1> and smallest for <h6> . Depending on the font being used
(more on fonts in Chapter 3), text contained in <h5> and <h6> tags may be displayed
smaller than the default text size.
HANDS-ON PRACTICE 2.2
Launch Notepad or another text editor and type in the following XHTML:
<!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>
 
Search WWH ::




Custom Search