Vertically and Horizontally Align Images: Image Tag and Attributes
Vertically and Horizontally Align Images: Image Tag and Attributes
Attributes:
Height Vspace
Width Border
Alt Align
Hspace
1. align (Horizontal)
o right
o left
o center
2. valign (Vertical)
o top
o bottom
o center
-Hot Spot
Now that you've got your image and co-ordinates, HTML comes to finalise your job. There
are three different shapes (commonly termed "hot spots") that can be used in image maps.
They are as follows:
-RECT
-CIRCLE
-POLYGON
Rectangle
This expects four coordinates. The horizontal position of the top-left corner, the vertical
position (from the top of the image) of the top-left corner, the horizontal position of the
bottom-right corner and the vertical position of the bottom-right corner. An example would be:
shape="rect" coords="10,20,75,40"
Circle
This expects three coordinates. The horizontal position of the centre, the vertical position of
the centre and the radius of the circle (percentage radii are taken as a percentage of the
shorter side of the image). An example would be:
shape="circle" coords="50,80,20"
Polygon
This expects as many pairs of coordinates as you need to make your polygon. These can
make any polygon shapes you need, and can have sloping lines. All coordinates are
specified as horizontal position then vertical position, with all of them in a long comma
separated list. The last pair of coordinates can optionally match the first. An example would
be:
shape="poly"
coords="217,305,218,306,218,306,228,316,243,316,243,325,229,325,229,322,217,310"
default
rect
circle
poly
coords Specifies the coordinates of the clickable area. Coordinates are specified as
follows:
Code
<img src="Desert.jpg" usemap="#green" border="0" height = "200" width = 300>
<map name="green">
</map>