Beginners guide to HTML

Lesson 4 - More Advanced Text

This continues with the basic text/words markup from lesson 1.

Centered Text

To center some text do the following:

<center>This is what you want centered</center>

Note the American spelling of center. The centering can be for large sections of the page, even the whole page.

Left / Right / Centered Text

You can alternatively use <div align=xxxx>Whatever you want aligned</div> - The xxxx can be LEFT (the default), RIGHT (for right justified text) or CENTER (which is the same as using <center></center>)

Quoted Text

If you have a quote, you may find the following advantageous:-

<blockquote>The Quick Brown Fox Jumps Over The Lazy Dog</blockquote> Quoted text may be displayed in italic and indented, the exact highlighting depends on the browser and its settings.

The Quick Brown Fox Jumps Over The Lazy Dog

Horizontal Lines

You can put a line across the page with a <hr>

You can put it across part of the page with a <hr width="50%"> this will make the line half the page width. The 50% should be in double quotes, the percentage is that of the width of the page.

You can make the line thicker using <hr size=5> This will make a line 5 times thicker than normal. Not all browsers support this attribute.

Extra Spaces

You can force an additional space by inserting &nbsp; this allows you to force two (or more) spaces should you really need it.

Pre Formatted Text

<pre>This will be displayed       just
as you have
typed it</pre>

This will retain spaces and new lines, using a fixed sized font.

Is typically displayed as:

This will be displayed     just
as you have
typed it

Next Lesson | Back to the index | Previous Lesson | Exercises

Home | Advice | Hosting

Updated 17th of October 2002