IMG- By using IMG tag and its SRC attribute we can add picture into our HTML document. It is empty tag.
<HTML><HEAD>
<TITLE>
Title of the document
</TITLE>
</HEAD>
<BODY>
<IMG SRC ="1.jpg">
</BODY>
</HTML>
Attributes of IMG Tag
- Src
- Width
- Heigh
- Alt
- Align
SRC (Source)- Using SRC attribute of IMG tag we can specify the source of image file.
<HTML>
<HEAD>
<TITLE>
Title of the document
</TITLE>
</HEAD>
<BODY>
<IMG SRC="1.jpg">
</BODY>
</HTML>
WIDTH- Using Width attribute of IMG tag we can specify the width of image file.
<HTML>
<HEAD>
<TITLE>
Title of the document
</TITLE>
</HEAD>
<BODY>
<IMG SRC="1.jpg" width=50%>
</BODY>
</HTML>
HEIGHT- Using Height attribute of IMG tag we can specify the height of image file.
<HTML>
<HEAD>
<TITLE>
Title of the document
</TITLE>
</HEAD>
<BODY>
<IMG SRC="1.jpg" height=50%>
</BODY>
</HTML>
ALT- If image display is not possible or disabled by the user then Alt attribute of IMG tag is used to specify alternate text for image information.
<HTML>
<HEAD>
<TITLE>
Title of the document
</TITLE>
</HEAD>
<BODY>
<IMG SRC="1.jpg" alt="Picture of Flower">
</BODY>
</HTML>
ALIGN- Using Align attribute we can align image using 5 values of Align attribute LEFT, RIGHT, TOP, BOTTOM, MIDDLE, MIDDLE.
<HTML>
<HEAD>
<TITLE>
Title of the document
</TITLE>
</HEAD>
<BODY>
<IMG SRC="1.jpg" align=left><br>
<IMG SRC="1.jpg" align=right><br>
<IMG SRC="1.jpg" align=top><br>
<IMG SRC="1.jpg" align=bottom><br>
<IMG SRC="1.jpg" align=middle>
</BODY>
</HTML>
UNIT-205
HTML Fundamentals
HTML Elements
HTML Fundamentals
HTML Elements
- HTML, HEAD, TITLE, BODY
- Attributes of Body Element: Background, Bgcolor, Text, Link, Alink, Vlink, Leftmargin, Topmargin
- FONT (Attributes of FONT Element: Color, Size, Face)
- IMG (Attributes of IMG Element: Src, Width, Height, Alt, Align)
- BASEFONT (Attributes of BASEFONT Element: Color, Size, Face)
- CENTER, BR
- HR (Attributes of HR Element: Width, Align, Noshade, Color, Size, Face)
- H1-H6 (Heading Elements)
- P (Paragraph), B (Bold), I (Italics), U (Underline)
- UL (Unordered List) Attributes of UL: Type
- OL (Ordered List) Attributes of OL: Type, Start
- Linking Internal and External Linking
- A (Anchor) Attributes of A Element: Href, Title, Name, Alt
- TABLE (Attributes of TABLE Element: Td, Th, Tr)