HTML and CSS Reference
title="Top Secret Plans"> Mark II Saucer </a>
Most browsers display the value of an anchor element's title in a small yel-
low tooltip box when the user's mouse hovers over the element for a couple of
seconds. Robots love title attributes and consider the information they contain
valuable. title attributes are important for search engine optimization.
An image is worth a thousand words on the Web as well. Images make a web
page more attractive. he images on a page give readers information that can-
not be gleaned from the text. For example, a simple line graph is more infor-
mative than a table of numbers. Images function importantly as page design
hree image formats are widely used on the Web. Graphics Interchange
Format (GIF) works well for simple line drawings and illustrations with plain
blocks of color. GIF format is limited to 256 colors in a single image but does
permit one color in the image's palette to be treated as fully transparent by
the displaying browser or other sotware. Joint Photographic Experts Group
(JPEG) format permits the use of millions of colors and is suitable for photo-
graphs and illustrations with gradient colors. JPEG images feature a variable
compression setting that can be used to balance image quality with ile size.
he last format, Portable Network Graphics (PNG) format, can be used for
either simple illustrations or colorful photographs. It has an eicient ixed
compression algorithm, so ile sizes are reasonable. It also has alpha transpar-
ency that can be controlled by CSS settings and manipulated by client-side
scripts. his makes it possible to fade the image in and out in response to a
To include an inline image on a page, use the self-closing image tag, <img/> .
No paragraph breaks or additional white space around the image are implied.
If text low around the image is not speciied, the image is inserted into the
text like a single odd-sized character. Unlike an image in a page layout pro-
gram, which can be anchored to a speciic spot on the page, an inline image on
a Web page is part of the text in which it is embedded. An inline image can be
placed anywhere a text character can be placed.
he image tag has two important, required attributes. he source attri-
bute, src , provides the URL of the ile containing the image data. he URL in
a source attribute follows the same rules as a URL in the href attribute of an
anchor or area element. he alternative text attribute, alt, is used to specify an