Creating Links in HTML
What is a Link in HTML?
Links (also called hyperlinks) in HTML allow users to navigate between different web pages, websites, or sections of the same page. Links are created using the <a> (anchor) tag.
š Key Points:
- ā <a> is used to create hyperlinks.
- ā href="URL" specifies the destination of the link.
- ā Links can open other web pages, files, email clients, or sections within a page.
Basic Syntax of an HTML Link
<a href="URL">Link Text</a>
Types of Links
- 1. Linking to Another Website (External Link)
- 2. Linking to Another Page in the Same Website (Internal Link)
- 3. Linking to a Section in the Same Page (Anchor Links)
Linking to Another Website (External Link)
<a href="https://www.wikipedia.org">Go to Wikipedia</a>
Linking to Another Page in the Same Website (Internal Link)
<a href="about.html">About Us</a>
Linking to a Section in the Same Page (Anchor Links)
<a href="#section2">Go to Section 2</a>
<h2 id="section2">Section 2</h2>
Opening Links in a New Tab (target="_blank")
<a href="https://www.infomax.org.in" target="_blank">INFOMAX</a>
Attributes of <a> Tag in HTML
Attribute | Description | Example |
---|---|---|
href | Specifies the destination URL of the link | <a href="https://www.google.com">Google</a> |
target | Specifies where to open the link | <a href="page.html" target="_blank">New Tab</a> |
name | Specifies the name of Link used as bookmark | <a name="top"></a> |
download | Allows users to download a file | <a href="file.pdf" download>Download PDF</a> |
title | Adds a tooltip on hover | <a href="demo.html" title="click to learn more">Read More</a> |
Qus. 1 : ______ is text with hyperlinks
- Lower Text
- Upper Text
- Toggle Text
- Hypertext
- <a href = "mailto: xy@y">
- <a href = "xy@y">
- <mail xy@y</mail>
- None of the above
- <hr>
- <br>
- <pre>
- <a>
- src
- href
- link
- rel
- New window
- Current window
- New tab
- Same tab
- target
- coords
- rel
- pos
- Normal and Blue
- Underline and Purple
- Underline and Magenta
- Underlined and Blue
- <a target=ā_selfā>Link</a>
- <a target=ā_blankā>Link</a>
- <a target=ā_topā>Link</a>
- <a target=ā_parentā>Link</a>
- <a email=āmailto:name@example.comā>email</a>
- <a mail=āmailto:name@example.comā>email</a>
- <a href=āmailto:name@example.comā>email</a>
- None of these
- <A HREF=āURLā> The text describing link </A>
- <HREF = āURLā> The text describing link </A>
- <HREF = āURLā> </A>
- None of the above
- Link
- ALINK
- VLINK
- All the above
- <a href=" url" new>
- <a href="url" target="new">
- <a href="url" target="_blank">
- <a href="url"target="">
- Visited link
- Virtual link
- Very good link
- Active link
- Text with heavy text jargons
- Text more than 1000 words
- Text which contains link to other texts
- None of the above
- List
- Links
- Address
- None
- src=ā_blankā
- alt=ā_blankā
- target=ā_selfā
- target=ā_blankā
- <hyperlink>
- <link>
- <href>
- <a>
- window="_blank"
- target="_blank"
- open="_blank"
- href="_blank"
- <a href='mailto:someone@example.com'>
- <mail>someone@example.com</mail>
- <email>someone@example.com</email>
- <a href='email:someone@example.com'>
- <a href=mob:8489849843ā></a>
- <mail> call:8489849843 </mail>
- <mob> 8489849843 </mob>
- <a href=ātel:8489849843 ā></a>
Programs
HTML program segment that contains hypertext links from one document to another
Create a hyperlink in html which when clicked links to www.google.com in a new window