Backup Copy of A694875 - Formatting Text
Created | Updated Sep 24, 2002
Tags in HTML can have many "attributes", or customizable features. Take, for instance, the paragraph tag. You can specify how you want the tag aligned: "left", "right", or "center".
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>
Testing Paragraphs
</title>
</head>
<body>
<p align="left"> blah blah blah </p>
<p align="right"> blah blah blah </p>
<p align="center"> blah blah blah </p>
</body>
</html>
In a similar vein, if you want to quote a largish passage from some author you can use the blockquote tag. This will justify the text (center it, and make all the text line up evenly on both sides so you have a solid block of text instead of getting a jagged right edge).
<blockquote> yadda yadda yadda </blockquote>blahblahblahyakyakyaketcetcetcyaddayaddayaddachatterchatterchatter. blahblahblahyakyakyaketcetcetcyaddayaddayaddachatterchatterchatter. blahblahblahyakyakyaketcetcetcyaddayaddayaddachatterchatterchatter. blahblahblahyakyakyaketcetcetcyaddayaddayaddachatterchatterchatter. blahblahblahyakyakyaketcetcetcyaddayaddayaddachatterchatterchatter. blahblahblahyakyakyaketcetcetcyaddayaddayaddachatterchatterchatter. blahblahblahyakyakyaketcetcetcyaddayaddayaddachatterchatterchatter.
Lists
While you could do lists with just paragraphs and line breaks, HTML has tags that will allow you to get a much nicer-looking list with very little effort.
Unordered lists are ones that just use bullets for each item in the list.
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>
Testing Lists 1
</title>
</head>
<body>
<ul>
<li> first item </li>
<li> second item </li>
<li> third item </li>
<li> etc </li>
</ul>
</body>
</html>
Gives:
- first item
- second item
- third item
- etc
Ordered lists use either upper- or lowercase letters, Roman or Arabic numerals to count off the different items. When you specify the type, simply put either "1","i","I","a", or "A" to show which kind of counting you want to use. I'll choose a numbered one with Arabic numerals:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>
Testing Lists 2
</title>
</head>
<body>
<ol type="1">
<li> first item </li>
<li> second item </li>
<li> third item </li>
<li> etc </li>
</ol>
</body>
</html>
Gives:
- first item
- second item
- third item
- etc
A definition list <dl> is made up of alternating a definition term <dt> and a definition description <dd>.
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>
Testing Lists 3
</title>
</head>
<body>
<dl>
<dt> Item 1 </dt>
<dd> Lots of stuff about Item 1. blahblah blah yakyakyaketcetcetc yaddayaddayadda chatter chatter chatter. blahblah blah yakyakyaketcetcetc yaddayaddayadda chatter chatter chatter.</dd>
<dt> Item 2 </dt>
<dd> Lots of stuff about Item 2. blahblah blah yakyakyaketcetcetc yaddayaddayadda chatter chatter chatter. blahblah blah yakyakyaketcetcetc yaddayaddayadda chatter chatter chatter.</dd>
</dl>
</body>
</html>
Gives:
- Item 1
Lots of stuff about Item 1. blahblah blah yakyakyaketcetcetc yaddayaddayadda chatter chatter chatter. blahblah blah yakyakyaketcetcetc yaddayaddayadda chatter chatter chatter.
- Item 2
Lots of stuff about Item 2. blahblah blah yakyakyaketcetcetc yaddayaddayadda chatter chatter chatter. blahblah blah yakyakyaketcetcetc yaddayaddayadda chatter chatter chatter.