How To Write A Link

Table of contents:

How To Write A Link
How To Write A Link

Video: How To Write A Link

Video: How To Write A Link
Video: How to Create a Text Link 2024, December
Anonim

For any site, its design and content are important. To link the two together, the site builder uses a link. A regular user clicks on the "News" link, and gets access to the site with news. Links are also a subject of business on the Internet, but let's take a look at how to create a link in an html document.

How to write a link
How to write a link

Instructions

Step 1

Tags are used to create elements in html language. We will also use them when creating the link. The tag "a" is responsible for creating a link on the site. This tag is closing, so don't forget to close it immediately. You can immediately write the name of the link between tags.

Step 2

The required attribute of the "a" tag is "href". It must always be specified. He is responsible for the address of the document to which the link will point. To do this, we assign the address value to the attribute (href = "link_address").

Step 3

Now you need to set the address in accordance with where it points. If the address will point to another site, then it is necessary to register the full path to the resource or document that is located there. But if the page or document is on your own site, then we write only the name of the page. If necessary, you can set an identifier for the tag that the link will refer to. For example, you can make a link that, when clicked, will send the user from the end of the document to the beginning. They are usually called "up". To do this, assign the “top” identifier to the “body” tag (id =”top”). After that, we assign the value of the "href" attribute to the value "#top". Now, when clicking on this link, the user will be taken to the top of the page.

Step 4

By default, when you click a link, the page opens in the same window. In order for the link to open in a new window, you must specify the "target" attribute. Let's assign it the value "_blank". The link will now open in a new window. The "_self" attribute will return the initial opening of the link in the same window.

Recommended: