- What is an Anchor (
<a>) tag? - Major roles of Anchor tag
- Commonly used attributes with anchor tag
<iframe>tag
An anchor tag is used to render a "Hypertext link" using the href attribute. It can link to Web Pages, files, email addresses, locations on the same page, or anything else a URL can address.
Important
An anchor tag is an inline element.
<a href="URL">Click Here!</a>In href give the relative path of about.html file.
<a href="about.html">About Us</a>In href give the relative path of contact.html file.
<a href="contact.html">Contact</a>📁05 - Anchor Tag
└── about.html
└── contact.html
└── image.jpeg
└── index.html
└── README.md
In href use the web address of any website to open the webpage.
<a href="https://www.google.com">Google</a><a href="#bottom">Move to bottom</a>Note
We can link any section using id's
href attribute is a required attribute for anchor tags.
Warning
Without href attribute anchor tag acts like a normal tag
target attribute is used to define where to open the given path.
Generally used value with target attribute are-
target= "_blank"To learn more about anchor tag attributes explore🔍!
We can Embed online videos through a corresponding <iframe>; tag.
Note
<iframe> tag specifies an inline frame.
An inline frame is used to embed another document within the current HTML document.
Search for a video on YOUTUBE
Click on
Share
Select the Embed option from them
Just - paste it on your HTML file



