Example -
Elements and Attributes

Previous page...

This new paragraph is aligned to the right!

This new paragraph is aligned to the centre!

This new paragraph is aligned to the left!

The HTML

<html>
<head>
	<title>Elements and Attributes</title>
</head>

<body>

<p align="right">This new paragraph is aligned to the right!

<p align="center">This new paragraph is aligned to the centre!

<p align="left">This new paragraph is aligned to the left!	

</body>
</html>

Important - the spellings in HTML are American (US). For example it is 'CENTER' not centre.


Elements and Attributes

So far we have looked exclusively at HTML Elements.

<html>, <head>, <title>, <body>, <p>, <br>, <small>, <pre>, <strong>, <tt>, <b> & <i> etc.

To gain more control over the appearance and functionality of a HTML document Attributes of each element can be used.

In the example on this page the align attribute of the p (paragraph) element was used to control the justification of the text.

Back to Top of Page

© 2003 Ashley Preston 

Computeach International Ltd