|
|
|
|
|
Maintained and designed by Shiroh©
|
|
|
The site with something for everyone
|
|
Tutorials> Building a web page: Properties of Tags
|
|
Formatting
Now that you have built your first web page we can deal with
some of the features of HTML that can make a web page have the
look and feel that you desire.
|
|
Properties of Tags
Properties of tags are know as attributes
. Of the tags we have seen so far only the
<BODY>
tag has attributes associated with it. Attributes are placed after the tag name but BEFORE the
closing (>) tag! Some attributes of the body tag are
TEXT
and BGCOLOR
. The body tag has many other attributes but these will be deal with in due course. All
of the attributes are accessed in the same way for all tags, that is, that there is a set
format for assigning values to attributes. The format is
ATTRIBUTE = "VALUE"
. Now, HTML is NOT case sensitive and as a result the attribute and the value
can be in normal font or caps. I, however, recommend that you use caps for all attribute names
so as to distinguish them from values and normal code. Let us now look at how to implement these atributes.
|
|
TEXT Attribute
The TEXT attribute allows you to change the color of the text.
You can set this to any conceivable color. This attributes accepts
two slightly different types of values. The first is a normal text
value such as "white" or "black". Black is the default for the text
attribute as you have probably noticed from your test page. So you can
change your text color by typing the following code
<BODY TEXT="green">
All of the basic colors such as white, black, green,
blue, red, cyan, purple, yellow, aqua, fuschia, gray, lime, maroon, navy, orange,
olive, silver and teal to name a few.
For custom colors you will have to use the hexadecimal rbg color code. For those
of us who just go a lot confused, all colors can be broken down into red, green and blue
components. A mixture of these components allows us to interpret different colors, so by changing
these values we can get any color imaginable. The hexadecimal part is simply that
the code numerical values are given in hexadecimal format.
The code looks like this #RRBBGG
. The hash (#) sign is used to denote that the value is
a hexadecimal value. The RRBBGG represents two numbers for the red component, two
for the blue component and two for the green. The values can be between
0 - 255, thus the reason for using hexadecimal code (you can get up to 256 distint numbers
using two digits!). Anyway to set the color of the text to red using hexadecimal it would look
like this
<BODY TEXT="#ff0000">
|
|
BGCOLOR Attribute
This will be a short paragraph.......the bgcolor attribute allows you to
change the color of the background of the page. It is set in the same was as
the TEXT attribute and can take any color you wish! The default....as you have already
noticed is......WHITE! :)
|
|
Time to experiment
Edit the test page that you have created and experiment with various colors!
You can click here to see an example.
|
|
Is this all I can do with HTML? No...here are some basic tags
|
|
|
|