Adding the Text

The following tags are used to format the text in the document between the <body> and </body> tags:

<h1> ... </h1>
<h2> ... </h2>
to
<h5> ... </h5>
<h6> ... </h6>

<h1>Page Topic</h1>

This tag is used around headings. The smallest number gives the largest font size. The text will be in the default typeface of the browser (usually Times New Roman) unless you modify it with these tags.

E.g.: This is h6.

This is h1.

For practical reasons you should use headings in a logical order; but the HTML code will work whatever order they are in.

Each page should have just one <h1> heading, usually the main heading or title at the top of the page. This can be followed by an <h2> heading for a sub-section. Another sub-section could have a further <h2> heading. These sub-sections can further subdivided using one or more <h3> headings... and they can be sub-divided with <h4> headings. It is rare for <h5> and <h6> headings to be needed.

<p>Type your text here!</p>

This tag is used around the text in each paragraph. The text will be in the default size and typeface of the browser (usually size 3, Times New Roman) unless you modify it with these tags.

Just enter the text between the <p> and </p> paragraph tags. However if you want to use "special" characters like & © ½ you will have to type their equivalent code in the HTML document. There is a list of some common special characters and their codes.

<br>

If you want to start a new line without starting a new paragraph, use this "break" tag.

align="center"

align="right"

align="left"

Use this to modify the <p> or <h1> - <h6> tags to align text to the centre (Note the American spelling of center) "right" to align text to the right, or "left" to align the text to the left (this is the default so you might only need it if you combine text and an image in the same paragraph). Text on web pages cannot be justified - unless you use Cascading Style Sheets.

<h5>So the code for this heading in h5 would look like this.</h5>

So the code for this heading in h5 would look like this.

<p>... and the code for this paragraph would look like this.</p>

... and the code for this paragraph would look like this.

Typing conventions

Using the carriage return key in an HTML file will not make the text in the browser start a new line, but it will make it easier to read your HTML code. You will find that 80 to 100 characters is long enough for a single line of text before you start to loose track of what you are typing. Tabs and multiple spaces are also ignored, so both examples of HTML code below would look the same in a browser.

In the first example an extra carriage return is used to split up the heading from the paragraph; in the second example the lines of text are shorter and extra spaces or tabs have been used to indent the text of the paragraph.

Carriage Return = carriage return Space = space Tab = tab

<h1>My First HTML Web Page.</h1> carriage return
carriage return
<p>This is the first paragraph of my first web page. It is carriage return
just a couple of sentences so that I can show how it does carriage return
not matter if you put line breaks, tabs or extra spaces in carriage return
the HTML code, the page will still look the same!</p>

<h1>My First HTML Web Page.</h1> carriage return
spacespace<p>This is the first paragraph of my first web carriage return
spacespacepage. It is just a couple of sentences so that carriage return
spacespaceI can show how it does not matter if you put carriage return
tabline breaks, carriage return
tabtabs or extra spaces in the HTML code, carriage return
tabthe page will still look the same!</p>