Transcript Chapter 2

The Web Wizard’s Guide
to HTML
Chapter Two
Basic Text Formatting
Chapter Objectives

Show how to create heading and paragraphs for
Web pages
 Explain how to control a variety of features
associated with text
 Learn how to add three types of lists to a Web
page
 Explore the layout and white-space controls for
blocks of text
Heading Elements

Headings come in six sizes
 <h1> </h1> is the largest heading
 <h6> </h6> is the smallest heading

Headings break up text with titles and
subtitles
Tag Attributes

Most HTML tags support their own set of
tag attributes
 Each attribute contains an attribute name
and an attribute value
 E.g. you can center a heading with an
alignment attribute:
<h1 align=“center”>
Breaking Up Text
The paragraph element <p> begins a block
of text after an empty line
 The break element <br> begins a block of
text on a new line
 The horizontal rule element <hr> inserts a
horizontal line to emphasize a break in the
text

Standard Type Face Options


<font face=“Arial”> </font>
It is best to specify type faces in groups since
different computers use different type fonts:
face=“Arial, Geneva, Helvetica”
face=“Times New Roman, Times”
face=“Courier New, Courier”
 Other useful font attributes include color and
size
Three Types of Lists
Ordered list
<ol>
<li> </li> Unordered list
<ul>
</ol>
<li> </li> Definition list
<dl>
</ul>
<dt> </dt>
<dd> </dd>
</dl>
White Space Management

Browsers are programmed to ignore extraneous
blank spaces and empty lines
 Controlling white space on a Web page requires
special HTML elements:
&nbsp;
<br>
<pre></pre>
<blockquote></blockquote>