How to create Web sites easily

The most complete guide for the Web page builder
All you'll
ever need to know about homepages and HTML

Document editing and basic tags: your first HTML page

Click here to return to the index

Got it? Well, let's learn how to edit an HTML document offline. The HTML documents are plain-text documents, that is, they are not binary files, so you can edit them with a plain-text editor, like Notepad or MS-DOS Editor (easy to know that I use a PC). You don't need any HTML editors, really.

Now comes the good part: the creation of an HTML document from scratch. First: all tags must be enclosed in < >.
Begin your document with the <HTML> tag, which informs the browser that the file's content in HTML. The matching end-tag </HTML> must be the last tag in the file.
This is an example of a small HTML document:

<HTML>
<HEAD>
<TITLE>Simple HTML Document</TITLE>
</HEAD>
<BODY>
A very simple HTML document.
</BODY>
</HTML>
As you saw, the title of this document was "Simple HTML Document", because it was enclosed within the <TITLE> and </TITLE> tags. The title and its tags usually go between the <HEAD> and </HEAD> elements, that denote the header of the doc. Any title that you specify will be written at the title bar of the browser. Other elements, explained later, can go between the <HEAD> tags too.
Normally, next comes the <BODY> tag, that specifies the body of the document. This text will be rendered at the main window of the browser. You should put all of the content of your page between the <BODY> and </BODY> tags.

Pay attention to this: there can be only ONE <BODY> tag, ONE <TITLE> tag and ONE <HTML> tag.

Paragraphs

Your page, as it is right now, has no text! Well, you can include text, but pay attention to this: your browser simply won't understand carriage returns and line feeds as the end of the paragraphs; there are codes for that. To begin a paragraph, use this tag:
<P>
That would give you a line break. If you only want to set a line break, use this:
<BR>
Every paragraph in this text begins with the <P> tag. Pretty simple, when you learn to manage this extraneous system.
This is a line break...
<BR> This is a line after the BR tag

<P> <= Here begins a new paragraph
This continues the paragraph

As you can see, the <BR> tag is a carriage return with a line feed, while the <P> tag is a bit more spaced than the <BT> tag.

Rulers

To insert a ruler, use the <HR> tag. This will insert a divisory line in your document, like the one at the beginning. To center it, put an ALIGN=CENTER parameter in the tag. To change the height of the ruler, use the SIZE=xxx parameter, where xxx is a value in pixels. To set the width of the ruler, use the WIDTH=xxx parameter, where xxx is a number in pixels, or, if followed by a % sign, a percentage of the entire view window width. This tag does not have any ending tags. For example, to set a ruler 80% width, aligned to the right, 6 pixels tall, use the following:
<HR WIDTH=80% SIZE=6 ALIGN=RIGHT>
One more thing, those fancy nice colored rulers are not of that kind. Those are graphics inserted in the document. Refer to the Links, Images and Bookmarks section for more info on how to insert graphical rulers (I'm against them, they load slower anyway).
Internet Link Exchange
Member of the ILE Free Home Pages at GeoCities


[Main page] [HTML help] [MIDI page] [Murphy's Laws] [More information]
[Feedback form to email me] [Sign guestbook] [Mail me!]