How to make a link on the page of your site

A link is an element of a website’s page (one or several words, a picture, button, etc.) pointing to another element of it, another page, or leading to third-party resources. Internal links lead to pages located within your own site. The link with which you can go to another resource is called external.

Any novice layout designer sooner or later thinks about how to make a link, since this element is an important component of any site, ensuring the interconnection of its pages with each other. Moreover, links permeate the Internet space, combining it into a single world wide web. As this element, as already mentioned, can be any image or a passage of text.

How to make a link on the site page?

It is set in the hypertext markup language - html using the pair tag "a" and consists of two main elements: address and text (or image). The address of any link corresponds to a special attribute - href. The text of this element is called anchor or anchor. In other words, the anchor is the place we get to by clicking on this link. The transition can be made to any page that exists on the network, as well as to any element that makes it up, regardless of its extension (html, rar, mp3, etc.). The color change of this element can be achieved by applying the cascading style sheet rule (css) to it.

How to make a link using an image?

You can add colorfulness to the page of your site by placing a link on it in the form of any picture. For these purposes, you will need the image itself, peacefully lying in a folder on a personal computer. Next, instead of the text located between the “a” tags, you should specify the path to this image, not forgetting to add the href attribute to the opening tag. If everything was done correctly, on the site page open in any Internet browser, you can see this image as a link. At the same time, a thin, but very noticeable frame will appear around it. In order to get rid of it, a separate a img selector is created in the css file and the border: none property is added to it (remove the frame).

How to make the link active?

Any modifications to the elements of a web page can be achieved by applying the properties of cascading style sheets. For example, a visited link in the css language is indicated as follows: a: visited; The link that the mouse cursor is over is: a: hover. Active is a working link leading to any page of the site or to a third-party resource. In order for it to be operational, after its attribute, you must specify the full address of the page or the site to which it leads. In this case, we can also answer the question of how to make the link clickable. To do this, copy the address of the page to which it will lead from the browser window. Further, it should also be placed in the html-code of the page after the attribute of this link.

How to make a link in the form of a button?

Buttons, after clicking on which go to any page of the site or a third-party resource, are also considered links. The appearance of those may vary significantly, depending on the imagination of the designer creating them. The usual button is drawn in Photoshop. It is a small picture placed on the page of the site in the process of layout. Next, in the html-code of the page in the tag "a" is another tag "img", indicating the picture. This tag should be added with an attribute indicating the path to the button image located on the developer's computer.

Creating various links on your site, it should be remembered that their main purpose is user convenience in terms of navigation. Too many of these elements can confuse the user, which in turn guarantees a decrease in site traffic. Links should be placed on its pages only if they are really necessary.

Source: https://habr.com/ru/post/K5210/


All Articles