Summary


One of the major features that makes the World Wide Web stand out from other elements of the Internet is that web pages can contain full-color images. Arguably, it was the existence of those images that helped the Web to catch on so quickly.

In this lesson you learned to place images on your Web pages. Those images are normally in GIF or JPEG format and should be small enough that they can be downloaded quickly over a slow link. You also learned that the HTML tag <img> enables you to put an image on a web page either inline with text or on a line by itself. The <img> tag has three primary attributes supported in standard HTML:

src

The location and filename of the image to include.

align

How to position the image vertically with its surrounding text. align can have one of three values: top, middle, or bottom. (Deprecated in HTML 4.01 in favor of style sheets.)

alt

A text string to substitute for the image in text-only browsers.


You can include images inside a link tag (<a>) and make them hot spots for the links.

In addition to the standard attributes, several other attributes to the <img> tag provide greater control over images and layout on web pages. You learned how to use these HTML 3.2 attributes in this lesson, but most of them have been deprecated in HTML 4.01 in favor of style sheets. They include the following:

align=

Places the image against the appropriate margin, align="right",

"left"

allowing all of the following text to flow into the space alongside the image.

clear

An extension to <br> that enables you to stop wrapping text alongside an image. clear can have three values: left, right, and all.

align="texttop"

Allows greater control over the alignment of an inline

align="baseline"_align="absbottom"

align="absmiddle" image and the text surrounding it.

vspace

Defines the amount of space between an image hspace and the text surrounding it.

border

Defines the width of the border around an image (with or without a link). border="0" hides the border altogether.


In addition to images, you can add color to the background and the text of a page by using attributes to the <body> tag, or to individual characters by using the color attribute to <font>. You also learned that you can add patterned or tiled backgrounds to images by using the background attribute to <body> with an image for the tile. Finally, you learned the CSS properties color, background-color, and background, which enable you to specify colors for your page without using deprecated tags.




Sams Teach Yourself Web Publishing with HTML and CSS in One Hour a Day
Sams Teach Yourself Web Publishing with HTML and CSS in One Hour a Day (5th Edition)
ISBN: 0672328860
EAN: 2147483647
Year: 2007
Pages: 305

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net