Sams Teach Yourself HTML 4 in 24 Hours

Sams Teach Yourself HTML 4 in 24 Hours

By Dick Oliver

Image Spacing and Borders

Figures 13.1 through 13.3 show the HTML text, images, and final appearance of a well-designed Web page. It meets all the criteria outlined in Table 13.1.

Notice the generous amount of space between images and paragraphs in Figure 13.3. Web browsers tend to crowd everything together, but you can easily add space three different ways:

13fig03.jpg

Figure 13.3 Thanks to generous spacing and a carefully premeditated layout, the HTML in Figure 13.1 looks great as a Web page.

You'll read about the width and height attributes of the <img /> tag later in this hour, in the "Specifying Image Width and Height" section.

The <img /> tags in Figure 13.1 also include a border="3" attribute, which enlarges the rectangular border around the images. The border is normally one pixel thick for any image inside an <a> link, but border="3" makes it three pixels thick.

The most popular use of the border attribute is making the image border disappear completely by typing border="0". This is especially handy with transparent images, which often look funny with a rectangle around them.

The color of the border will be the same as the color of any text links. In this page, images that link to pages someone hasn't visited yet will have maroon borders. Images that link to a recently visited page will have green borders.

Share ThisShare This

Informit Network