How to Install Operating System ??Complete Guide Installing The Operating System

How To Make Links HTML

e-Book Computer – In this tutorial, we will discuss creating links in HTML, before discussing the material we will first discuss the notion of links. How To Make Links HTML Hyperlinks are a way to connect documents to one another, the use of these links is very important, for example, what happens to be an uninterrupted road from city to city, as well as links, how a reader can see other pages on a website, then you need navigation as a guide for readers to go to other parts of the website or outside, write links in HTML using an <a> tag or anchor link.

Understanding The <a> Tag in HTML

Is short for anchor, which is a tag to define a text or image that has a purpose or reference to another page or on the page itself, the <a> tag is written in pairs between the opening <a> tag and closing tag </a> where the inner element is used to define a hyperlink.

Not all elements written between the <a> tag become a hyperlink, creating links with the <a> tag depends on the href attribute, if a text or image is defined using the <a> tag and does not have the href attribute in it, the element shows a placeholder.

Before going forward, there are a number of articles that you might be looking for.

Read too :

Attributes The <a> Tag in HTML

The following are the attributes contained in the <a> (anchor link) tag that can be used to create links in HTML, not all attributes of the <a> tag are listed in the table below, if the table feels less, the reader can see it on the w3schools page about the <a> tag that we are discussing.

Attribute The <a> Tag Anchor Link

AttributeValueInformation
HrefURLSpecifies The Address or Destination ID
Hreflanglanguage_codeDetermine the language used
Target_blank, _parent, _self, _top, framenameTo determine how to open the link.
Relalternate, author, bookmark, help, license, next, nofollow, noreferrer, prev, search, tagDetermine the relationship between the document that is being opened or another document referenced by the link.

How to Make Links in HTML

Until here I assume the reader has understood the attributes of the <a> tag (anchor link) in the table above, Here is how to write the <a> tag to create a link in HTML.

<a href=”link_aim”> Link names </a>

For more details, the author will create two pages, namely page index.html and menu.html where the second page will be connected to each page, here is a hierarchy of pages, menu.html file is stored in the “menu” directory.

For the root directory, you can use any folder, because like the discussion that HTML is a client-side language to run it you don’t need to use a web server. Next, please open any text editor as desired, then type the code below and save it as index.html.

<! DOCTYPE html>

<html>

<head>

<title> How to make a link in HTML </ title>

</ head>

<body>

<h1> Creating a hyperlink in HTML </ h1>

<p> Below is a link that is directed to the menu page | <a href=”menu/menu.html”> MENU </a> </ p>

</ body>

</ html>

Next, create a new directory that is in the root directory, then type the html code below and name it menu.html, then save it to the menu directory that was created.

<! DOCTYPE html>

<html>

<head>

<title> How to make a link in HTML </ title>

</ head>

<body>

<h1> Creating a hyperlink in HTML </ h1>

<p> The following is a link to return to the index | page <a href=”../index.html”> INDEX </a> </ p>

</ body>

</ html>

Until here the link creation was successful, from the example above the author only uses text, you can change it using images.

In HTML, the type of link is divided into two parts, namely relative and absolute, the difference between the two types is only the way to write the destination address, let’s try to explain it to be easier to understand.

Understanding Relative Links

Relative links are links that can be said to be links that lead directly to the location of the path or destination directory stored on a web server or computer without starting with the domain address of the website, so that its use depends on the location of the file, for example.

<a href=”relatif.html”> Relative Link </a>

Or…

<a href=”directory/relatif.html”> Relative Link </a>

And if you want to take a step back to the current page location to the previous page, you must use “../” to move to the page in the directory above or to the previous page.

Understanding Absolute Links

Absolute links are links that point directly to a particular website, where a document is locked on the valid address of a website and does not depend on the HTML document location directory. So that the address can be used on other websites as long as the address is still valid, for example.

<a href=”http://domain.com/absolut.html”> Absolute </a>

Actually a link does not only have to go to another page, basically the use of the href attribute can also be directed to the ID of a tag, so that when clicked it will go to the id not to another page even though you can also point to another page with ID attribute on the page the browser’s destination and automatically will point to the owner’s element ID.

Before proceeding, there are a number of articles that might be looking for.

Also read :

Sending
User Review
0 (0 votes)

Add a Comment

Your email address will not be published. Required fields are marked *