GeoCities.us GeoCities.us » SiliconValley » Horizon Get your FREE home page!
Lesson 2: Dressing Up Your Words
Start Here  |  Lesson 1  |  Lesson 2  |  Lesson 3

Open the index.html you made in Lesson 1, in Notepad and in your browser, side by side. Everything in this lesson goes between <body> and </body>.

The browser ignores your Enter key

Type three short paragraphs in Notepad, pressing Enter between them, and reload. They all run together into one lump. This surprises everybody. The browser pays no attention to how you lay out your typing: extra spaces, extra Enters, tabs, all of it gets squeezed down to a single space. You have to tell it where the breaks go.

<p>This is my first paragraph.</p>
<p>This is my second one.</p>
Roses are red,<br>
violets are blue.

<p> starts a new paragraph with a blank line above it. <br> just drops to the next line, like the carriage return on a typewriter. <br> has no closing tag; it doesn't go around anything.

Headings

There are six sizes of heading, from <h1>, the biggest, down to <h6>, the smallest. Use one <h1> at the top for the name of your page, and <h2> or <h3> for the sections under it.

<h1>Welcome to Ollie's Page</h1>
<h3>My Grandchildren</h3>
WHAT YOU'LL SEE

Welcome to Ollie's Page

My Grandchildren

Bold, italic and centered

I am <b>very</b> proud of my <i>tomatoes</i>.
<center>This line sits in the middle.</center>
WHAT YOU'LL SEE
I am very proud of my tomatoes.
This line sits in the middle.

A word from your old typing teacher: bold is like shouting. A little of it gets attention. A whole page of it and people stop listening. There's an underline tag, <u>, but please don't use it. On the Web, underlined words look like links, and people will click on them and wonder why nothing happens.

Size, color and typeface

The <font> tag changes how words look. It takes three settings, called attributes, that go inside the opening tag:

<font size="5" color="#990000" face="Arial">Big red words</font>
  • size goes from 1 (tiny) to 7 (enormous). Regular text is 3.
  • color can be a plain English name like red or navy, or a code with a # in front. The codes look scary but they're just three pairs: how much red, how much green, how much blue, from 00 (none) to FF (all). #FF0000 is all red. #000000 is black. #FFFFFF is white. #000080 is navy.
  • face is the typeface. Stick to ones everybody has: Arial, Times New Roman, Courier New. If your visitor doesn't have the one you picked, they get the plain standard one instead.

Coloring the whole page

To change the colors of the whole page at once, add attributes to your <body> tag:

<body bgcolor="#FFFFF0" text="#000000" link="#0000CC" vlink="#551A8B">

bgcolor is the background, text is the words, link is links you haven't visited yet, and vlink is links you have. Those four are the colors of this very page. Whatever you pick, please keep dark words on a light background, or light on dark. Peter, who is fifty-three, made his page yellow on white the first week. Nobody could read it but Peter.

Lines and lists

<hr width="50%">
<ul>
<li>Bread</li>
<li>Milk</li>
</ul>
<ol>
<li>Wash the car</li>
<li>Call my sister</li>
</ol>
WHAT YOU'LL SEE
  • Bread
  • Milk
  1. Wash the car
  2. Call my sister

<hr> draws a line across the page. <ul> is a list with dots; <ol> is a list with numbers, and the browser counts for you. Each thing in either list gets its own <li>.

Two handy extras

Notes to yourself. Anything between <!-- and --> is invisible in the browser. Use it to leave yourself reminders, like <!-- put the picture of the dog here -->.

Special characters. Since < and > mean "here comes a tag," you can't just type them. Write &lt; for <, &gt; for >, and &amp; for the & sign itself. &copy; makes a ©.

Homework for Lesson 2
1. Give your page an <h1> heading with your name.
2. Write three paragraphs about yourself with <p> tags.
3. Make a list of five things you like.
4. Pick two colors for your page, one dark and one light, and put them in your body tag. Only two. Trust me.

On to Lesson 3: Links and Pictures »

Start Here  |  Lesson 1  |  Lesson 2  |  Lesson 3
Stuck? [email protected] · Last updated: September 21, 1999