Dr. Pete's Quick Reference Guide to Popular HTML Tags

Tagwhat it does
<html> </html> <html> must be the first line of your web page file and </html> must be the last line.
<title> </title> Contains the web page title to be displayed on the browser's title bar. This goes immediately after the <html>.
<body bgcolor="color">
</body>
The entire displayed content of your web page goes between these tags. Uses the specified color for background. For color, substitute one of the 216 color codes, see http://www.immigration-usa.com/html_colors.html. The code is a hash mark (#) followed by the 6 digit code, in quotes. For example, bgcolor="#CC3366" is a medium pink-red. Your web page can only have one <body> </body> pair!, and the entire displayed content goes between them.
<body background="filename"> </body> If you want to use a background image instead of a plain color, specify background= instead of bgcolor=. For filename, substitute the name of the picture file. Your web page can only have one <body> </body> pair!, and the entire displayed content goes between them.
<p> </p> Display the enclosed text as a paragraph. Leaves a blank line above the paragraph.
<br> Forces a break to the start of the next line. There is no closing tag.
<i> </i> Renders the enclosed text in italics
<b> </b> Renders the enclosed text in bold
<center> </center> Centers the enclosed text, pictures, and links.
<img src="filename"> Insert a picture. For filename, substitute the name of the picture file. There is no closing tag. Works easiest if the file is in the same folder as your web page.
<a href="target_page">
</a>
Defines a link. For target_page, substitute the address of the web page you want the user to be taken to when the link is clicked. Be sure it starts with "http://". In front of the closing </a> tag, put the text (or image) that will be displayed for the user.
<font size=value> </font> Controls the font size of the enclosed text. For value, substitute the size you want. Use small integers such as 3 or 4 or 5. You can make it relatively larger by using +1, +2, etc, or smaller by using -1, -2, etc.
<font color=value> </font> Controls the color of the enclosed text. For value, substitute the color value you want. See the description of colors in the entry for <body>. Both size and color can be specified in the same font tag.
<ul> </ul> Defines a bulleted list (l is lower case L). Within a list, you define each item using <li> </li>
<ol> </ol> Defines a numbered list. Within a list, you define each item using <li> </li>
<table border=1> </table> Defines a table, with given border thickness. Within a table, you define each row using <tr> </tr> and within each row you define each cell using <td> </td>    (<th> </th> for cells containing a heading).
<h3> </h3> Renders the enclosed text as a large heading! Six sizes are available, with <h1> the largest and <h6> the smallest.

An example web page with tags highlighted. Browser will display it as shown below.

To see the full effect, view it on the browser instead of the printed copy.

<html>
<head>
   <title>This is my page!</title>
</head>
<body bgcolor="#99FF66" text="#660033">
<h2>Sampler of HTML Tags</h2>
<br>
What you <b>type</b> in HTML will be rendered by
the <i>browser</i>
<ul>
   <li>most tags are used as bookends like begin and end</li>
   <li>other tags have only a beginning with implicit end</li>
   <li>a few tags can be used either with or without an end</li>
</ul>
<center>This line and everything below it will be centered on the page.
<table border=1>
   <tr>
      <th>name</th><th>age</th>
   </tr>
   <tr>
      <td>Lauren</td><td>27</td>
   </tr>
   <tr>
      <td>Charles</td><td>18</td>
   </tr>
</table>
<img src="OfficeDracula.jpg">
<br>
<a href="http://www.osu.edu">Ohio State Home Page</a>
<br>
<a href="mailto:psanderson@otterbein.edu">Send me email</a>
<br>
I am having <font size=+3 color="#CC0066">so</font> much fun!
</center>
</body>
</html>

Sampler of HTML Tags


What you type in HTML will be rendered by the browser
  • most tags are used as bookends like begin and end
  • other tags have only a beginning with implicit end
  • a few tags can be used either with or without an end
This line and everything below it will be centered on the page.
nameage
Lauren27
Charles18

Ohio State Home Page
Send me email
I am having so much fun!