HTML and CSS Reference
In-Depth Information
Allows greater control over the alignment of an inline
align=“absmiddle” image and the text surrounding it.
align=“texttop”
Defines the amount of space between an image hspace and
the text surrounding it.
vspace
Defines the width of the border around an image (with or
without a link). border=“0” hides the border altogether.
border
In addition to images, you can add color to the background and the text of a page using
CSS.You learned the CSS properties color , background-color , and background , which
enable you to specify colors for your page without using deprecated tags. You also
learned about the HTML attributes that were once used to specify colors before CSS was
widely supported.
Workshop
Now that you know how to add images and color to your pages, you can really get cre-
ative. This workshop will help you remember some of the most important points about
using images and color on your pages..
Q&A
Q What's the difference between a GIF image and a JPEG image? Is there any
rule of thumb that defines when you should use one format rather than the
other?
A As a rule, you should use GIF files when images contain 256 colors or fewer.
Some good examples are cartoon art, clip art, black-and-white images, and images
with many solid color areas. You'll also need to use GIF files if you want your
images to contain transparent areas or if you want to create an animation that does-
n't require a special plug-in or browser helper. Remember to use your image-
editing software to reduce the number of colors in the image palettes whenever
possible, because this also reduces the size of the file.
JPEG images are best for photographic-quality or high-resolution 3D rendered
graphics because they can display true-color images to great effect. Most image-
editing programs enable you to specify how much to compress a JPEG image. The
size of the file decreases the more an image is compressed; however, compression
can also deteriorate the quality and appearance of the image if you go overboard.
You have to find just the right balance between quality and file size, and that can
differ from image to image.
 
 
Search WWH ::




Custom Search