|
HTML Tutorial: Poetry |
|
|
<br> and <p> tags.
To begin, remove 100% of the body content from index.html. Yours should look like the one on the left. Got it?
See where it says "?? site"? If your name is "Judy Jones" change that to "Judy Jones' wonderful new site".
If it's 2008 and your name is Fred Frelanski, change the "Copyright ??" to "Copyright 2008, Fred Frelanski".
If you're neither Judy nor Fred, go ahead and use your own name.
This is a poem
About HTML.
Learn it now
And it will serve you well.

Yes, your browser has no taste for poetry and no respect for the way your text is formatted. You have to give it directions.
<br>.¹ This is not: < br >. HTML is pretty loose about most things, but one thing you can't do: put anything between the opening "<" and the tag name.
Start by putting a break tag (<br>) after every line of your poem:
This is a poem<br>
About HTML.<br>
Learn it now<br>
And it will serve you well.<br>
Here's what you should get when you save and reload index.html. (You don't need any more save/reload reminders, do you?)

<br> that follows "About HTML." to a paragraph tag between the verses:
This is a poem<br>
About HTML.
<p>
Learn it now<br>
And it will serve you well.<br>
<p> tag at the end of the previous line or at the start of the next line. It's more human-readable if you put it on a line of its own. Be nice to yourself and write HTML as if you may need to read it a week or a month from now.
align= attribute that accepts "left", "center" and "right" as values.
<p align=center> centered! </p>
<p align=right> right aligned! </p>
<p align=left>...</p> is nearly useless, as left is the default. Those working in Arabic or Hebrew, however, think right alignment is useless.
On your own, experiment with the align attribute of the enclosing paragraph and end paragraph tags. Something like this will be interesting:
<p align=center>This is a poem<br>
About HTML.</p>
<p align=right>
Learn it now<br>
And it will serve you well.</p>
align=elegantly or align=righht. What do you get?
When the browser can't understand the HTML, it gives no error messages. It just reverts to the default, left alignment. Remember that your browser will never give you an HTML error message.
Next, we'll use boldface and italic and lots of other text decorations.
| Let's decorate text! |
¹This is the break tag in XHTML: <br />. If you see that, realize that it's just another way to get a break. XHTML is supposed to replace HTML, but I don't think that's going to happen. The standards body sort of forgot that there are thousands of us who want to communicate in cyberspace, but don't want to become full-time, professional webmasters.