The Paradox

7: Images and Objects

Images are actually a special kind of object. So are applets, in fact, although html4.01 strict does not support them any more, in preference to the OBJECT tag.

The OBJECT tag contains information on what kind of object it is, and surrounds 'alternate' text, as in IMG's alt= element. The OBJECT tag is preferred as it explicitly states the embedded object type, and thus can be used for nearly every kind of object, including images, applets, movies, and other HTML documents. Because there is not one tag for each, when a new object type comes along the browsers do not need to be modified to accept yet another new tag, but can just read the object type from the OBJECT tag.

Two equivalent constructs would be:

<IMG src="images/flag.gif" alt="canadian flag">
or
<OBJECT data="images/flag.gif" type="image/gif">canadian flag</OBJECT>

Both of these would display the png image 'images/somepic.png' with the same alternate text:
canadian flag (IMG) or canadian flag (OBJECT)

Both IMG and OBJECT support elements in their tags that define the size of the object on the page: the 'height' and 'width' elements. This will actually speed up rendering of a page. Some browsers don't like to render the text around an image until it knows how big it is, and without this tag, they don't find that out until the image is loaded. Some browsers will render the text around a 'default-sized' image placeholder, and then when the image is loaded, they will re-render the page to fit the image in properly. If these elements are given, the browser will make a properly sized placeholder and can render the rest of the page properly while waiting for the image to finish downloading.

The object can also be aligned or floated using stylesheets. The align element in images and objects is no longer part of the new HTML specification.

The OpenNIC You are using the legacy domain name, paradox.homeip.net, to access this site. This site is also available through the OpenNIC system as www.paradox.null. For more information, please visit The OpenNIC web site. To learn how to configure your computer for OpenDNS, please click here, or see this page to learn how to configure your name server.

This page was last modified Saturday July 06, 2002

Valid HTML 4.01!