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

AttributeDescriptionExample
hrefSpecifies the destination URL of the link<a href="https://www.google.com">Google</a>
targetSpecifies where to open the link<a href="page.html" target="_blank">New Tab</a>
nameSpecifies the name of Link used as bookmark<a name="top"></a>
downloadAllows users to download a file<a href="file.pdf" download>Download PDF</a>
titleAdds a tooltip on hover<a href="demo.html" title="click to learn more">Read More</a>
Qus. 1 : ______ is text with hyperlinks

  1. Lower Text
  2. Upper Text
  3. Toggle Text
  4. Hypertext
Qus. 2 : Which of the following is the correct way to send mail in HTML?

  1. <a href = "mailto: xy@y">
  2. <a href = "xy@y">
  3. <mail xy@y</mail>
  4. None of the above
Qus. 3 : The tag used for creating hypertext and hypermedia links is

  1. <hr>
  2. <br>
  3. <pre>
  4. <a>
Qus. 4 : URL for link is specified using ___ attribute.

  1. src
  2. href
  3. link
  4. rel
Qus. 5 : A linked page using anchor tag is normally displayed in

  1. New window
  2. Current window
  3. New tab
  4. Same tab
Qus. 6 : Which attribute is used to specify where to open the linked document?

  1. target
  2. coords
  3. rel
  4. pos
Qus. 7 : Default style and color of unvisited link in any browser is

  1. Normal and Blue
  2. Underline and Purple
  3. Underline and Magenta
  4. Underlined and Blue
Qus. 8 : Which of the following is used to open document in new window / Tab ?

  1. <a target=ā€_selfā€>Link</a>
  2. <a target=ā€_blankā€>Link</a>
  3. <a target=ā€_topā€>Link</a>
  4. <a target=ā€_parentā€>Link</a>
Qus. 9 : To create a link to an email address, which of the following syntax is used?

  1. <a email=ā€mailto:name@example.comā€>email</a>
  2. <a mail=ā€mailto:name@example.comā€>email</a>
  3. <a href=ā€mailto:name@example.comā€>email</a>
  4. None of these
Qus. 10 : The basic format for text link is:

  1. <A HREF=ā€URLā€> The text describing link </A>
  2. <HREF = ā€œURLā€> The text describing link </A>
  3. <HREF = ā€œURLā€> </A>
  4. None of the above
Qus. 11 : Which attribute can be used to change the colour of the visited links?

  1. Link
  2. ALINK
  3. VLINK
  4. All the above
Qus. 12 : How can you open a link in a new browser Window?

  1. <a href=" url" new>
  2. <a href="url" target="new">
  3. <a href="url" target="_blank">
  4. <a href="url"target="">
Qus. 13 : What does vlink attribute mean?

  1. Visited link
  2. Virtual link
  3. Very good link
  4. Active link
Qus. 14 : Hypertext is a:

  1. Text with heavy text jargons
  2. Text more than 1000 words
  3. Text which contains link to other texts
  4. None of the above
Qus. 15 : <a> tag in HTML is used for creating

  1. List
  2. Links
  3. Address
  4. None
Qus. 16 : In HTML, which attribute is used to create a link that opens in a new window tab?

  1. src=ā€_blankā€
  2. alt=ā€_blankā€
  3. target=ā€_selfā€
  4. target=ā€_blankā€
Qus. 17 : Which HTML tag is used to create a hyperlink

  1. <hyperlink>
  2. <link>
  3. <href>
  4. <a>
Qus. 18 : Which attribute is used to open a hyperlink in a new window

  1. window="_blank"
  2. target="_blank"
  3. open="_blank"
  4. href="_blank"
Qus. 19 : What is the correct way to create an e-mail link in HTML

  1. <a href='mailto:someone@example.com'>
  2. <mail>someone@example.com</mail>
  3. <email>someone@example.com</email>
  4. <a href='email:someone@example.com'>
Qus. 20 : What is the correct way to create a telephone link in HTML

  1. <a href=mob:8489849843ā€™></a>
  2. <mail> call:8489849843 </mail>
  3. <mob> 8489849843 </mob>
  4. <a href=ā€˜tel:8489849843 ā€˜></a>

Programs

HTML program segment that contains hypertext links from one document to another

View Solution


Create a hyperlink in html which when clicked links to www.google.com in a new window

View Solution


Latest Current Affairs 2025 Online Exam Quiz for One day Exam Online Typing Test CCC Online Test Python Programming Tutorials Best Computer Training Institute in Prayagraj (Allahabad) Online MBA 2 years Online MCA Online BCA Best Website and Software Company in Allahabad