| <<< Home | << Web | < HTML Notes | Top | Bottom | < Prev | Next > |
|
Topics on this page:
This page barely scratches the surface on the topic of image alignment. For a lot more information and examples, visit my Image Alignment and Fun with dots.
The align attribute
The align attribute of the image tag primarily specifies how text around the image
is aligned rather than how the image itself is aligned. The exception is When you omit the align attribute, the image is treated very much like just a character. Compare the following: <p> Some text <font size="+3">X</font> More text </p><p> Some text <img src="images/wolfmail.jpg" width="50" height="35" alt="" /> More text </p> Some text X More text
Some text
Three align values are used to align a single line of text with the image. The
default is <p> Some text <img src="images/wolfmail.jpg" width="101" height="69" alt="" align="bottom" /> More text </p><p> Some text <img src="images/wolfmail.jpg" width="101" height="69" alt="" align="middle" /> More text </p><p> Some text <img src="images/wolfmail.jpg" width="101" height="69" alt="" align="top" /> More text </p>
Some text
Some text
Some text
The other two align values - "left" and "right" - work a bit differently. These place the image on the left or right side of the page, and cause text to wrap around it. <p> Some text <img src="images/wolfmail.jpg" width="101" height="69" alt="" align="left" /> Text - text - text - text - text - text - text - text Text - text - text - text - text - text - text - text Text - text - text - text - text - text - text - text Text - text - text - text - text - text - text - text Text - text - text - text - text - text - text - text Text - text - text - text - text - text - text - text Text - text - text - text - text - text - text - text Text - text - text - text - text - text - text - text Text - text - text - text - text - text - text - text Text - text - text - text - text - text - text - text </p><p> Some text <img src="images/wolfmail.jpg" width="101" height="69" alt="" align="right" /> Text - text - text - text - text - text - text - text Text - text - text - text - text - text - text - text Text - text - text - text - text - text - text - text Text - text - text - text - text - text - text - text Text - text - text - text - text - text - text - text Text - text - text - text - text - text - text - text Text - text - text - text - text - text - text - text Text - text - text - text - text - text - text - text Text - text - text - text - text - text - text - text Text - text - text - text - text - text - text - text </p>
Some text
Some text
The hspace and vspace attributes
hspace adds some blank space to the left and right of an image. For example,
<p>
Some text
<img src="images/wolfmail.jpg" width="101" height="69" align="left"
alt="" hspace="30" />
Text - text - text - text - text - text - text - text
Text - text - text - text - text - text - text - text
Text - text - text - text - text - text - text - text
Text - text - text - text - text - text - text - text
Text - text - text - text - text - text - text - text
Text - text - text - text - text - text - text - text
Text - text - text - text - text - text - text - text
Text - text - text - text - text - text - text - text
Text - text - text - text - text - text - text - text
Text - text - text - text - text - text - text - text
</p><p>
Some text
<img src="images/wolfmail.jpg" width="101" height="69" align="right"
alt="" hspace="40" vspace="20" />
Text - text - text - text - text - text - text - text
Text - text - text - text - text - text - text - text
Text - text - text - text - text - text - text - text
Text - text - text - text - text - text - text - text
Text - text - text - text - text - text - text - text
Text - text - text - text - text - text - text - text
Text - text - text - text - text - text - text - text
Text - text - text - text - text - text - text - text
Text - text - text - text - text - text - text - text
Text - text - text - text - text - text - text - text
</p>
Some text
Some text
The clear attribute of <br />
When you use
Here's an example of using
<img src="images/browndot.gif" width="200" height="100"
alt="" align="left" />
Here's some text. Nothing of any importance whatever.
<br clear="left" />
This text is below the image. It's still insignificant.
clear="right" does the same thing for an image that has align="right":
<p align="right">
<img src="images/browndot.gif" width="200" height="100"
alt="" align="right" />
Here's some text. Nothing of any importance whatever.
<br clear="right" />
This text is below the image.
</p>
In both of the above examples, <img src="images/browndot.gif" width="100" height="100" alt="" align="right" /> <img src="images/browndot.gif" width="100" height="200" alt="" align="left" /> Here's some text. How very interesting. <br clear="right" /> Here's the text that comes after clear="right". <br clear="all" /> This is after the clear="all".
Centering an Image
There's no way to center an image by using the align attribute of <img>.
There is no <center> <img src="images/wolfmail.jpg" width="101" height="69" alt="" /> </center>
|
| <<< Home | << Web | < HTML Notes | Top | Bottom | < Prev | Next > |