Formatting Text in HTML


Headings Tags in HTML

HTML CodeResult on web page
<h1>heading 1 is the biggest</h1>

heading 1 is the biggest

<h2>heading 2 is a bit smaller</h2>

heading 2 is a bit smaller

<h3>heading 3 is smaller still</h3>

heading 3 is smaller still

<h4>heading 4 is a bit smaller again</h4>

heading 4 is a bit smaller again

<h5>heading 5 is the smallest</h5>
heading 5 is the smallest

Aligning Text using the Headings Tags in HTML

HTML Code- - - - - - - - - - Result on web page- - - - - - - - - -
<h5 align=left>heading 5 is the smallest</h5>
heading 5 is the smallest
<h5 align=center>heading 5 is the smallest</h5>
heading 5 is the smallest
<h5 align=right>heading 5 is the smallest</h5>
heading 5 is the smallest

Organising your Text

<p>This is a paragraph tag</p>
<br> This is a line break


Changing the text style

HTML CodeResult on web page
<b>This text is bold</b> This text is bold
<i>This text is italic</i> This text is italic
<u>This text is underlined</u> This text is underlined
<b><i><u>This text is bold, italic and underlined</b></i></u> This text is bold, italic and underlined

Changing the colour of your text

Note the American spelling of colour: color.
HTML is an American language and therefore uses the American spelling.
Please make sure that you continue to use the English spelling when you are not writing in HTML!

HTML CodeResult on web page
<font color="red">This text is red </font> This text is red
<font color="green">This text is green </font> This text is green
<font color="blue">This text is blue </font> This text is blue
<font color="orange">This text is orange </font> This text is orange
<font color="yellow">This text is yellow</font> This text is yellow

Aligning your text

Note the American spelling of centre: center.
Please make sure that you continue to use the English spelling when you are not writing in HTML!

HTML Code- - - - - - - - - - Result on web page- - - - - - - - - -
<p align ="center"> This text is centred </p>

This text is centred

<p align ="left"> This text is on the left </p>

This text is on the left

<p align ="right"> This text is on the right </p>

This text is on the right


Changing fonts

Note the American spelling of centre: center.
Please make sure that you continue to use the English spelling when you are not writing in HTML!

HTML CodeResult on web page
<font face=Arial> The font is Arial</font> The font is Arial
<font face=verdana> The font is Verdana</font> The font is Verdana
<font face=times new roman> The font is Times new roman</font> The font is Time new Roman