HTML MADE EASY
Free Graphics | Graphics Optimizer | Resources | Freeware
Personalized Mugs | JPEGCruncher Desktop | T-Shirts

Visit Art.com

Lesson 3: Attributes

Telling Tags What To Do
You probably noticed that the text on your web page is pretty small. We are about to change that with a new tag*:

<FONT> </FONT>

Inside this tag we are going to put what's called an attribute. Attributes tell tags how or where they are to display the stuff that is between them. To change the size of text we will use the SIZE attribute inside the FONT tag* like so:

<FONT SIZE="6">practice</FONT>

Result:

practice

Note that the attribute was only required for the beginning tag. Note also the quotation marks around the 6, very important, never forget to put them in when using attributes otherwise it may mess up your webpage. You may use any size from 1 to 7, with 1 being the smallest,and 7 the largest.

Color
Another attribute that can be used with the FONT tag is COLOR:

<FONT COLOR="#FF0000">practice</FONT>

Result:

practice


"#FF0000" is the code for red. Notice the # in front of the code, don't forget to include it inside the quotes. You can use the name of the color instead but it's better to use the code since some older browsers will not understand color names. Click here for a list of color codes and their names.

Style
To change the style of text add the FACE attribute to the FONT tag:

<FONT FACE="arial">practice</FONT>

Result:
practice

Keep in mind that the style of font the viewers of your web page see depends on the style fonts they have installed on their computer. If they don't have the style you're using for your webpage, they'll get the default setting of their browser.

You can use any combination or all attributes in the font tag like so:

<FONT SIZE="7" COLOR="red" FACE="arial">practice</FONT>

Notice that each attribute is separated by a space. Here's the result:

practice


*ABOUT THE FONT TAG:
Even though the FONT tag still works, it's function has now been replaced with CSS. The FONT tag is used in this lesson to show you how attributes work in HTML tags. An introduction to CSS is included in The Complete HTML MADE EASY


Attributes work the same way in other tags. Remember the heading tag <H>? You can have it on the right side of your

web page like this

by using the ALIGN attribute in the beginning heading tag:

<H3 ALIGN="right"> your text </H3>

The stuff between the beginning and end tag will be on the right side of the page. Notice again that the attribute is only required for the beginning tag. Go try some attributes yourself and on with lesson 4.




Put your site to work - Click for more info