HTML Tags and How to use Them

This site's purpose is to explain and demonstrate four different tags that are common in most HTML pages. They are the image tag, anchor tag, background tag, and the marquee tag. This page will display examples and explanations of all of these tags and how to use them.

What is a Tag?

A tag is a text string used in HTML to identify a pages type, format, and appearance. Different tags can be used to make an anchor, define a baackground color, or make an image appear. There are over 50 different tags that do different things. Four tags are going to be explained and demonstrated in this page.

The Image Tag

In HTML documents, images are defined with the tag. The tag is an empty tag, that means contains only attributes and does not have a closing tag. To display an image on a page, you have to use the src attribute. Src stands for the "source" of where the image is located.The src attribute is the URL of the image that is to be displayed. Example...... Patriots Superbowl Ring The image at left was produced using the <.img src="URL".> tag.

The URL tells the tag where the location of the image is. The browser puts the image where the image tag occurs in the document. If you put an image tag between two different paragraphs, the first paragraph will appear, then the image, and then the second paragraph. The image tag is used frequently on most websites.

The Anchor Tag

HTML uses anchors to point to any resource on the web, this includes sound files, images, html pages, movie, etc. Html uses the tag to make a link to another document. Example:New England Patriots Homepage. The anchor tag always has to include the "href" attribute, the attribute is used to address the document that you are linking to. The words between the open and close of the tag will be displyed as a hyperlink.

The anchor tag can also be used with the name attribute, which is used to create a link that jumps directly into a specific section on a page. This is better than having the user scroll through the page to find what they want. Anchors can be very useful and resourceful.

The Background Tag

All pages look better with a colored background, instead of a boring and plain white background. The<.body> tag has two different attributes that you can use to specify the background. The background can be a color or an image.

Bgcolor

The Bgcolor attribute specifies a color to fill in the page background. The colors come from one of three sources, a hexadecimal number, an RGB value, or a color name. Example:

The lines above all are Black in color.

Background

The background attribute specifies a background image for an HTML page. The background image comes from the URL of the image you want to use. If the image is smaller than the browser's window. Example:

The URL can be relative (as in the first line above) or the whole URL( as in the second line).

Marquee

The Marquee tag creates a scrolling display. The Marquee is often regarded as an "Evil" tag, and that is why it is not common on web pages. The Marquee tag isn't such a bad tag, it can be used for announcements. Example: Patriots: 3 Superbowl wins in 4 years, Modern day dynasty! A Marquee is a cool feature that can be used very effectively on HTML pages.

All 4 of these tags can be used to make an HTML site look good and work more effectively. The image tag helps put up an image to help describe what your page is about. The Anchor takes you to a specific part of the site. The Background tag can make your page look better, and a Marquee Can be used for a heading or announcement.

References used: http://www.web-source.net/html_codes_chart.htm/. http://hotwired.lycos.com/webmonkey/reference/html_cheatsheet/

Back to Student Pages

Copyright Pat Atton 2006
Last Updated: 02/09/06
Saugus High School Web Design Class