HTML Tags: <img>, <font>, <a> (Hyperlink)
Introduction to HTML Tags
HTML (HyperText Markup Language) is the standard language for creating webpages. It uses various tags to
define elements such as text, images, and links. This document covers:
- <img> - Image tag
- <font> - Font formatting tag (deprecated)
- <a> - Anchor (hyperlink) tag
1. Image Tag: <img>
The <img> tag is used to embed images into a webpage. It is a self-closing tag.
Attributes:
- src: Specifies the image path (URL or local file)
- alt: Provides alternate text
- width and height: Define image size.
Image Example:
<img src="cat.jpg" alt="Cute Cat" width="300" height="200">
2. Font Tag: <font>
The <font> tag is used to change the font style, size, and color. It is deprecated in HTML5.
Attributes:
- color: Sets the text color
- size: Font size (1 to 7)
- face: Font type.
Font Example:
<font color="red" size="5" face="Verdana">This is styled text</font>
HTML Tags: <img>, <font>, <a> (Hyperlink)
3. Hyperlink Tag: <a>
The <a> tag defines a hyperlink.
Attributes:
- href: Specifies the link destination
- target="_blank": Opens the link in a new tab.
Hyperlink Example:
<a href="https://www.google.com" target="_blank">Visit Google</a>
Complete Example Program:
<!DOCTYPE html>
<html>
<head>
<title>HTML Example</title>
</head>
<body>
<h2>My Web Page</h2>
<img src="cat.jpg" alt="Cute Cat" width="300" height="200">
<p><font color="blue" size="4" face="Arial">Welcome to my website!</font></p>
<p>Visit <a href="https://www.wikipedia.org" target="_blank">Wikipedia</a> for more info.</p>
</body>
</html>
Conclusion
HTML Tags: <img>, <font>, <a> (Hyperlink)
The <img> tag adds visual content.
The <font> tag styles text (CSS preferred now).
The <a> tag creates navigation links.
These tags enhance both the functionality and user experience of webpages.