HTML - The Basics

Centering Text and Preformatted text

Often a diagram or quote is displayed to its best advantage when centered. At other times, it is simpler to forget all the other types of tags and just display preformatted monospaced text. However, this preformatted text is not inspiring at all.... Finally, we see the old horizontal rule tag and its amazing scaling powers.


Centering Web Content

Nothing could be simpler. Just place everything you plan to center within the CENTER tag.

This is not centered, however we can <CENTER>Center this text <BR>OKAY! </CENTER> WOW!
This is not centered, however we can
Center this text
OKAY!
WOW!


Preformatting Text

Unlike ordinary text which can run and run and which is then the browser automatically wrapping long lines, the PREformated text tag will only wrap the lines in which you've started on a new line.

<PRE>
Notice how long this line can run in your text editor, but when displayed in the browser, it just runs and runs and runs.
</PRE>
<PRE>
It ran off the side of
the browser!!!

However this bit of text
is shorter because I've
pressed the return key to
begin several new lines.
</PRE>

Notice how long this line can run in your text editor, but when displayed in the browser, it just runs and runs and runs.


It ran off the side of 

the browser!!!


However this bit of text is shorter because I've pressed the return key to begin several new lines.


Horizontal Rule Revisited

It is possible to scale the horizontal rule tag HR by defining its WIDTH.

A bit of text here or some interesting things to look at.
<HR>
More of the same stuff, more or less
<HR width=75>
Ditto last bit.
<HR width=75%>
See what I mean...
A bit of text here or some interesting things to look at.
More of the same stuff, more or less
Ditto last bit.
See what I mean...

The ordinary tag by itself spans the width of the browser window (here represented by the purple rectangle). When the width is a plain integer number, the horizontal line is centered and the length of the number of pixels (75) across the screen. When you place the percentage sign after the number, it will take up that percentage of the screen, here 75%

That's about all I've got to say about Basic HTML. Hope you like it.


Previous Index Site Index