HTML Tutorial – Lesson 5: More on Formatting your Text

By now i’ll bet that you’ve got a very informative page with a beautiful link to someplace (this site? please?) on it. That’s great, but i’ll bet you’re hungry to make it look even more beautiful than it already is (or maybe your boss demands it)! Well, read on!

Do you like your name to stand out on your pages? HTML has some special tags that allow us to change the way our text is shown. One of them is the <B>, or boldface tag. You can also make text in italics with the <I> or italics tag. Text can be underlined with the <U>, or underline tag. These tags need both an opening tag and a closing tag, so the format is <I>, <B>, or <U>text to be formatted</I>, </B>, or </U>.In addition to these “regular” formatting tags, there are
lots of “special” formatting tags. Heres a list of them:

Special formatting tags

  1. <SMALL> – Small text
  2. <BIG> – Big text
  3. <SUPER> – Superscript
  4. <SUB> – Subscript
  5. <STRIKE> – Strikethrough text (text with a line through it)
  6. <TT> – Monospaced (typewriter style) text
  7. <PRE> – Preserves all format and line breaks in the HTML source

Text formatting is great! Here’s how to align your text. When you align your text, it lines up with that portion of the window. Left aligned text (the default) is lined up with the left side of the window. It works just like if you were using a word processor and clicked the left align button. However, there is no align tag. Instead there is what’s called the align attribute. An attribute is an argument that is put into a tag to change the way that tag works. The align attribute can be put into many different tags to format paragraphs or blocks of text (pictures too-more on this later). If we wanted to make a paragraph aligned to the center of our window, we’d add the align attribute to the <P> tag at the beginning of that paragraph. It would look like this:

This paragraph is aligned to the center. This
was accomplished by using the align attribute.

Here’s how it would show up in the browser
window:

This paragraph is aligned to the center. This
was accomplished by using the align attribute.

There is also a way to format multiple paragraphs of text. We can do this by using the <DIV>, or division tag. The division tag really doesn’t do anything without the align attribute, or another attribute. It’s completely useless without attributes!

The <DIV> tag is used like this:
<DIV align=”left”>
This is the text to be left aligned. I can align lots of text with the division tag!

</DIV>
If we put this into our web page, it shows up in a browser like this:

This is the text to be left aligned.
I can align lots of text with the division tag!

The align tag can also be used in headers. If you want your header to be eye catching, align=”center” it!

All this stuff is great, but i bet you’re worrying about the small margin space in your pages. Well, that can be fixed with one easy tag: the <BLOCKQUOTE> tag! Simply put a <BLOCKQUOTE> right under that <BODY> tag, and a </BLOCKQUOTE> right above the </BODY>, and you’ll have beautiful margins in your page with minimal work!

Now you should be an expert in text format and alignment. Take a few minutes to absorb what you’ve just learned, and surf to the next lesson.

If you enjoyed this post, make sure you subscribe to my RSS feed!

Tags: , , , ,

Leave a Reply