Now time to learn a few more things about html tags. Some of the tags available allow you to set Attributes. Attributes are simply settings that tell the browser to display the tag information in the way you specify. For instance you may have noticed when you checked out how our html file was coming along and that when it loaded it had a dull grey or white background. That is because no background color attribute was set in the <body> tag to tell the browser to load a different colour than the default of grey or white or whatever you default color might be
There are two attributes that allow you to change how the background of your Web page will display. One is:
bgcolor="#hex number here"
and the second is:
background="filename.extension here"
NOTE: The "" (quotes) have to be present. With all attributes that have the attribute="value" you should get in the habit of enclosing the value in quotes. This saves you from having to memorize which require quotes and which can have them by choice. All attribute values work perfectly fine enclosed in quotes, but some will not work without them. |
Changing the Color of the Background, Text and Links
Believe it or not all of this can be accomplished by changes to the first
tag!Simply adding any or all of these attributes to the intial <BODY> you can get a very colorful web page. NOTE: All of the different attributes can be added to the SAME <BODY> tag. < BODY BGCOLOR="#000000" TEXT="#FFFFFF"> will create web page with a black background and white text. These attributes should all be added to the same body tag.
BGCOLOR: Changes the color of the background of the page.
TEXT: Changes the color of the text on the page. This is an overall change and can only be done once on a page.
LINK: Changes the color of the links you have on your page BEFORE a guest on your page "clicks" on them to visit.
ALINK: Changes the color of an Active Link, or how a link looks when it is being clicked.
VLINK: Changes the color of a Visited Link, or how a link looks to the guest if they have already been to that site.
The big questions are why/how "#000000" equals black, "#FFFFFF" equals white
and how do you figure out what the other colors are?
Colors for web pages
which are usually referred to as hexidecimal equilvents or RGB values, are
determined by a formula. The numbers and letters that make up the color
represent the amount of red (first two), green (second two) and blue (third
two), or RGB value in that color. Altering the amount of any or all of them
creates the desired color(s).
Using BACKGROUND= "name.gif" will change the background of the page to the image you have selected
If you have your images in a different folder than your html document you must supply the exact folder tree to that file. For example if your background image was xxxx.jpg and it is stored on your hard drive in a folder called images but your html document was stored in a folder called web site than you would have to type:
<body background="\images\xxxx.jpg">
This allows the browser to locate the image on the web server or on your hard drive. Once again however, if you have your images and html file in the same folder it is only necessary to type the filename not where it is located on the server or hard drive.