Formatting TextAll right, you've made it this far! Now it's time to actually put something on a page. After all, the reason why you are doing this (presumably) is to tell someone something. To do that you need to include some text. HTML has made this very easy. It was designed, after all, to present text in a readable format to others all over the world. Cute things like images, flash, videos and sound came much later. The main tag that you need to know when formatting text is the <P> or paragraph tag. This, quite simply, defines a paragraph of text.
This has the following result in Internet Explorer.
Adding a second paragraph is just as easy.
And here is how that looks.
y default, paragraphs are aligned to the left side. You can change the
alignment to the right or center by including those tags.
This gives you the following result.
You can do lots of other things with the paragraph tag which we will get into in future lessons. Now that you can put text on the page, let's quickly go over some of the other things that you can do. If you want to put some text on a new line without starting a new
paragraph, use the <BR> tag (this does not have a corresponding </BR>
tag).
As you can see from the results below, a line break was inserted in the middle of the second paragraph. Note that the line break DOES NOT start a new paragraph. The <B> tag lets you indicate that some text is to be bolded. This is an example of bolded text. You must include the closing </B> to indicate where the bolding is to stop.
You can also italicize text, which shows the characters leaning to the right. To do this, use the <I> tag to begin and the </I> to end it. This is an example of text which is italicized.
Another cool feature is the ability to underline text. This is done with the <U> and </U> tags. For example, this text is underlined.
You can include tags within each other. For example, if you want to bold and underline something, you could do the following.
An important thing to remember about this (it's called nesting) is that the tags must be closed in the opposite order in which they were opened. In the example above, you will notice that we start with <B> and follow with <U>. We must close with </U> first followed by </B>. All right, now you know how to do some simple formatting of HTML pages. You've learned how to include paragraphs, break lines within paragraphs, and include special formatting such as bolding, underlining and italicizing. |