on air

HTML Anchors, IDs, and Hyperlinks.

back home » webtutorials » HTML » HTML Anchors, IDs, and Hyperlinks.


Scenario.

In this example, you'll learn about Anchors, and Hyperlinks, their differences, and the way they work. Hope your cerebrum catches up with this easily.

Anchor <a>.

Anchor <a> tag is an HTML element used to define a link in a document. The following attributes are use with the <a> tag.

  • HREF [ The HREF attribute defines the destination of a link.]
  • NAME [ The NAME attribute defines a "value" that can be used with the HREF attribute.] -Deprecated, but supported by all major browsers-
  • ID [ The ID attribute defines a "value" that can be used with the HREF attribute.] -Highly Recommended-

Anchor Name.

The NAME attribute <a name> is used to define the anchor name's value.

The anchor name's value is used to link, between articles, within a page (Bookmark).

This is always placed inside the <a> element. It's used the same way as the HREF attribute for a hyperlink. See illustration below.

The name attribute of the <a> element is deprecated in XHTML.

<a name="AnchorNameTuts">Anchor Name Tutorials.</a>

ID.

The ID attribute <element id="value"> is used the same way as the NAME attribute.

ID can be used with almost every HTML element.
The ID attribute is XHTML specified, and highly recommended. See illustration below.

<a id="IDTuts">ID Tutorials.</a>

<element id="IDTuts">ID Tutorials.</a>

HREF.

The HREF attribute is used to define a destination for a hyperlink. This could be used to define an absolute or a relative destination link. See illustration below.

<a href="URL">Destination description Text.</a>

Examples Of Hyperlinks.

In the examples below, the defined ID's value "IDTuts" is used for the HREF's "URL". For the HREF to reach a destination correctly. The ID's value must always start with a hash sign [#] like this: #IDTuts. See illustration below.

The HREF is also used to create an E-mail Hyperlink. Learn how.

<a href="https://www.anothersite.com/tutorials.html">
Tutorials</a>

<a href="https://www.mysite.com/tutorials.html#IDTuts">
ID Tutorials</a>

<a href="#IDTuts">ID Tutorials</a>

Explanation.

  • The first link will absolutely reach the www.anothersite.com as in the "URL" of the HREF attribute, and to a page named tutorials.html.
  • The second link will reach a page on www.mysite.com, named tutorials.html, and to an article with a defined ID's value "IDTuts".
    • Note: Using a defined ID or an Anchor name for an HREF's URL, a hash sign [#] must always be placed in front of the ID's value like this: [#IDTuts]
  • The third link will relatively, reach to a bookmarked destination within the same document with an ID's value "IDTuts".

Image As Hyperlink.

Image could also be used as a hyperlink button. See illustration below.

<a href="URL"><img src="URL"></a>

The Hyperlink is set around the image URL. So whenever a user click on the image it will send them to a targeted destination.

HTML Anchor Hyperlinks

Clicks4UrMind

Man will give you worldly powers, and make you feel on top of all, note this is temporally and could be redrawn at anytime sending you back to the ground floor of life. However, the Lord Almighty, the one and the only rightful ruler of the Universe, blesses everlastingly.

Brain

Knowledge is Power, but Power is not Knowledge. Wisdom is the truthful Power that identifies the Knowledge within the man. And only, I repeat 3x. Only the almighty God has the power to bless the man with his Wisdom forever.

To achieve the Lord's blessings, cease not praying daily, asking for his Wisdom, and you'll be blessed abundantly...

SPYERA PHONE

Spyera Phone

Spyera Phone version is software that you install on a smart phone to monitor everything happening on the phone. After installation, SPYERA secretly records events (sms, call history, phone book, location, emails, What's App messages, IM, Facebook Chat, Skype, See photos taken and many more...) that happen on the phone and delivers these information to a web account, where you can view these reports 24/7 from any Internet enabled computer or mobile phone. SPYERA also allows you to listen to the surroundings of the target mobile , listen to the phone conversation and to know the location of the device.


Please, Kindly Donate What You Can, Enabling Us Pay Hosting And Domain Costing, And Do More.

Please Donate