HTML | Tags and Attributes [Multimedia] [Add Image]




Ü Attaching image to a HTML document : To attach image to a HTML document one will have set the following code,
          <IMG SRC=”..” BORDER=”..” HEIGHT=”..” WIDTH=”..” ALIGN=”..”>

Attribute
Description
SRC=”..”
The value of SRC attribute specifies the image file location.
BORDER=”..”
The value of BORDER attribute specifies the width of the border around the image.
HEIGHT=”..”
It specifies the height of the image
WIDTH=”..”
It specifies the width of the image
ALIGN=”..”
It is used to align the image, values are LEFT, RIGHT and CENTER
Now consider the following input and output.

Input :
<HTML> <HEAD><TITLE>Others</TITLE></HEAD>
<BODY>
Setting image<BR>
<IMG SRC="libra.jpg" BORDER=2 HEIGHT=100 WIDTH=96><BR>
Setting image alignment
<IMG SRC="libra.jpg" ALIGN="RIGHT" BORDER=4 HEIGHT=120 WIDTH=116>
</BODY></HTML>
Output :

 Ü Image as background : To set a image as a background use the following code,
              <BODY BACKGROUND=”…………”>
The value of the attribute BACKGROUND will be the image file location.

Recommended Recommends

Comments

Contact Us