31) <IMG> Attributes
ALIGN: used to set the alignment of the text adjacent to the image. It takes the following values:
ALIGN = LEFT - Displays image on left side and the subsequent text flows around the right hand side of that image.
ALIGN = RIGHT - Displays the image on the right side and the subsequent text flows around the left hand side of that image.
ALIGN = TOP - Aligns the text with the top of the image.
ALIGN = MIDDLE - Aligns the text with the middle of the image.
ALIGN=BOTTOM - Aligns the text with the bottom of the image by default, the text is aligned with the bottom of the image.
Example: Using <IMG> tag with attributes
<HTML>
<HEAD>
<TITLE> Use of IMG Tag with its ALIGN Attribute</TITLE>
</HEAD>
<BODY>
<P>
<IMG SRC=shahidminar.jpg ALIGN=TOP>
Aligns the text with the Top of the image
</P>
<P>
<IMG SRC=shahidminar.jpg width="150" height="120" ALIGN=MIDDLE>
Aligns the text with the Middle of the image
</P>
<P>
<IMG SRC=shahidminar.jpg ALIGN=LEFT>
Displays image on left side and the subsequent text flows around the right
hand side of that image.
</P>
<P>
<IMG SRC=shahidminar.jpg width="150" height="120" ALIGN=RIGHT>
Displays image on right side and the subsequent text flows around the left hand side of that image.
</P>
</BODY> </HTML>
Figure : Images with height and width
ALIGN: used to set the alignment of the text adjacent to the image. It takes the following values:
ALIGN = LEFT - Displays image on left side and the subsequent text flows around the right hand side of that image.
ALIGN = RIGHT - Displays the image on the right side and the subsequent text flows around the left hand side of that image.
ALIGN = TOP - Aligns the text with the top of the image.
ALIGN = MIDDLE - Aligns the text with the middle of the image.
ALIGN=BOTTOM - Aligns the text with the bottom of the image by default, the text is aligned with the bottom of the image.
Example: Using <IMG> tag with attributes
<HTML>
<HEAD>
<TITLE> Use of IMG Tag with its ALIGN Attribute</TITLE>
</HEAD>
<BODY>
<P>
<IMG SRC=shahidminar.jpg ALIGN=TOP>
Aligns the text with the Top of the image
</P>
<P>
<IMG SRC=shahidminar.jpg width="150" height="120" ALIGN=MIDDLE>
Aligns the text with the Middle of the image
</P>
<P>
<IMG SRC=shahidminar.jpg ALIGN=LEFT>
Displays image on left side and the subsequent text flows around the right
hand side of that image.
</P>
<P>
<IMG SRC=shahidminar.jpg width="150" height="120" ALIGN=RIGHT>
Displays image on right side and the subsequent text flows around the left hand side of that image.
</P>
</BODY> </HTML>
Figure : Images with height and width
0 comments:
Post a Comment