|
The image element has a much more complex align attribute then most other elements. The align attribute
values are absbottom, absmiddle, baseline, bottom, center, left, middle, right, texttop and top.
We will not go over all of these in this lesson, but all of them effect the way text is laid out
around an image when that image is laid "inline" within a paragraph (between an opening and
closing p tag).
The border attribute specifies the number of pixels the browser should border an image with. If you want to turn
the border off, you can set it equal to zero. The width and height attributes can be used to resize an
image. The browser will only resize the image to the these attribute values if the image size is different
then the size you specified.
The two graphic types that are usually used on web pages are GIF with a .gif file extension and JPEG with a .jpg or
.jpeg file extension. These are not the only types of graphics that browsers are able to display, but they are the
most common, and the only types we will discuss in this lesson. Each of these graphic types has different
applications. The reason for this has to do with the differing compression schemes. JPEGs are typically better
suited for photographs, while GIFs are better suited for graphics with few colors in solid color patterns (Example:
company logos, text, etc.).
Example: Notice in the following example the difference between the appearance of the JPEG and GIF
caused by the different compression schemes. Please look over the following source code and formatted
pages and feel free to experiment with the source to alter the layout.
View Source
View Formatted Page |