What the heck are "Attributes" and
How are they used ?
Take a tag, say the
<IMG SRC=" ">
and use it as is:
or you can be more definitive:
which gives you
The
HEIGHT=80, WIDTH=60, BORDER=0 and ALT=" "
are called attributes.
Why do I NEED all that extra stuff???
Actually, each serves a specific function, and has a real purpose.
The
The
In a page full of graphics, any decrease in load times is very helpful.
<A HREF="kisshtml.htm">
<IMG SRC="images/img-ex1.gif" HEIGHT=80 WIDTH=60 ALT="Green Square">
</A>
<A HREF="kisshtml.htm">
<IMG SRC="images/img-ex1.gif" HEIGHT=80 WIDTH=60 BORDER=6 ALT="Green Square">
</A>
This is also helpful to those who surf the web with their graphics turned off, or who are using a browser, such as Lynx, which doesn't read graphics.
Another usage is informational. It can, for instance, say ALT="Click Here".
Note: if you move your mouse cursor over an image with an "ALT=" " tag and hold it there, you can read what the "ALT=" " attribute says.
Almost every HTML tag (even the lowly <P> tag), can have Attributes. In these tutorials, we discussed Attributes for the "Horizontal Rule" in Lesson #8.
Check it out!
If your image doesn't load, instead of just a broken graphic, the ALTernate tag tells what image should be there.
We also discussed Attributes for <Table> "TH" in Lesson #18,