Tag Attributes and Color

Attributes

Many tags have attributes that can be set to modify the tag in some way. As you work through the lessons you will learn about the attributes of the various tags. The first set of attributes is one of the most exciting.

<body bgcolor="green"> makes the page background red. Here is an example:

<html>
<head><title>Title in the blue area.</title></head>
<body bgcolor="red">

This area is for web page content.

</Body>
</html>

These attributes are used in the usual <body> tag at the beginning of the web page. Here is a list of all the attributes that go with the <body> tag:

text="color" Sets a default color for text.
link="color" Sets a color for a link before it is used.
vlink="color" Sets a color for a link that has been used.
alink="color" Sets a color for when the mouse passes over the link or is being clicked.
bgcolor="color" Sets the background color for a page.
background="file.jpg or gif" Sets a graphics image as a background. Can be either jpg or gif files.

 

Assignment

Open up "index.htm".

Rename it "color.htm"

Add text on any subject that you wish.

Change the background color using the bgcolor attribute and the text color using the text attribute.

Save the file. Email it to me at legacyhighwebone@yahoo.com

Make sure it works by viewing it in the browser.

Back to the outline.