Computers, part of your life – Grade 11, 2nd Edition
Appendix B: HTML Tag Sheet
Structural / Basic tags
<html> </html> Starts and ends a web page
<head> </head> Contains information about the file
<title> </title> Defines a title for the file
<body> </body> Defines the body of web page
<body bgcolor="pink"> Sets the background colour of web page
<body text="black"> Sets the colour of the body text
<!-- --> Comment
Formatting Tags
<p></p> Creates a new paragraph
<p align="left"> Aligns a paragraph to the left (default), can also be right, or center
<br/> Inserts a line break
<ol></ol> Creates a numbered list
<ol type="A", "a", "I",
Defines the type of numbering used
"i","1"></ol>
<ul></ul> Creates a bulleted list
<ul type="disc",
Defines the type of bullets used
"square", "circle"></ul>
Inserted for each list item, and adds a number or symbol, depending upon the
<li></li>
type of list selected
Text Tags
<h1></h1> Creates the largest heading
<h6></h6> Creates the smallest heading
<b></b> Creates bold text
<i></i> Creates italic text
<font size="3"> </font> Sets size of font, from 1 to 7
<font color="green"> </font> Sets font colour
<font face="Times New Roman"> </font> Sets font type
Graphics Tags
<img src="name"> Adds an image
<img src="name" align="left"> Aligns an image: left, right, center; bottom, top, middle
<img src="name" border="1"> Sets width of border around an image
<img src="name" width="200" height ="200"> Sets the height and width of an image
Specifies the text that should be displayed if the image
<img src="name" alt="alternative text">
cannot be displayed
<hr/> Inserts a horizontal line
<hr size="3"/> Sets size (height) of line
<hr width="80%"/> Sets width of line, in percentage or absolute value
<hr color="red"/> Sets the colour of the line
Link Tags
<a href="URL"> link text </a> Creates a hyperlink displaying the link text
<a href="URL"> <img src="name"> </a> Creates an image link
<a name="NAME"> </a> Creates a target location
<a href="#NAME"> </a> Links to a target location created somewhere else in the file