|
|
Aligning text and objects around imagesThe ALIGN attribute of <IMG> tag helps in aligning other elements like text with respect to the image. It can take any of the following values:
However, a situation might arise when you would like to place only some text, say, a small description, on the left or right side of the image with the rest to flow after the image. In our example, we want to align "What a fine idea!" to the left of the image with other sentences to be placed after the image. If you use the following code, you shall not get the desired results. <IMG SRC="bulb.gif" WIDTH="128" HEIGHT="220" ALT="Fine idea" ALIGN="RIGHT"> What a fine idea!<BR>The bulb in this ...
You'll notice that the next line - "The Bulb in this ..." - also lies to the left of the image, while we wanted to place it below the image. To force the next line to place below the image, we use CLEAR attribute of <BR> tag with "ALL" as value. Thus, placing <BR CLEAR="ALL"> right after the phrase will force the next line to start at a new line. <IMG SRC="bulb.gif" WIDTH="128" HEIGHT="220" ALT="Fine idea" ALIGN="RIGHT">< What a fine idea!<BR CLEAR="ALL">The bulb in this ...
Page contents: Understanding web page formatting and how to align text and other objects on a web page around images using the ALIGN attribute of the HTML <IMG> tag.
Page URL: http://www.webdevelopersnotes.com/tips/html/ aligning_text_and_objects_around_images.php3
|
|