HTML links

We see what are the links in HTML and the different types.

So far, we have been able to see that a web page is an HTML file in which we can include, among other things, formatted texts to our liking and images (we will see them in detail soon). In the same way, a website can be considered as the set of files, mainly HTML pages and images, that constitute the content to which the navigator has access.

However, we could not talk about navigating or browsing if these HTML files were not properly connected to each other and to the outside of our site by means of hypertext links. Indeed, the original appeal of HTML lies in the possible linking of the contents of the files by introducing references in the form of links that allow quick access to the desired information. It would be of little use in the network to have isolated pages that people cannot access and from which people cannot jump to others.

A link can be easily detected by the user on a page. Just slide the mouse pointer over the images or text and see how it changes from its original shape, usually turning into a hand with a pointing finger. Additionally, these links are usually, in the case of texts, colored and underlined so that the user does not have difficulty in recognizing them.

syntax of a link

To place a link, we will use the A tags and their closure. Within the opening tag we must also specify the destination of the link. This destination will be introduced in the form of an attribute, which is named “href”.

See also  Install Ubuntu "Software Center" in Lubuntu

The general syntax of a link is therefore of the form:

content

Being the “content” a text or an image. It is the part of the page that will be active and where we must click to access the link. For its part, “destination” will be a page, an email or a file.

For example, a link to the home page would look like this

Desarrolloweb.com Home

Now, if we want the content of the link to be an image and not a text, we can place the corresponding IMG tag inside the A tag.

The appearance of the links

Using HTML and CSS style sheets, we can define how the links will look on a page. However, by default the browser highlights them so that we can distinguish them. Generally we will find the links underlined and colored in blue, although this rule depends on the user’s browser and its styles defined as default.

In the case of the images that serve as a link, they traditionally appeared framed in a blue frame by default. Although that default style will also change depending on the browser and in fact in 2016 most browsers don’t put that blue frame anymore so we have an example of how default styles can change over time and with browser versions.

Due to this uncertain default style, it is always interesting to mark for ourselves the style that the links must have on our page. The correct thing to do is place that style in the CSS code, but it can also be defined in the BODY tag. That is something that was explained in the article.

See also  Web Developer, extension for Firefox

Types of links

To study the links in depth we have to classify them by their type, because depending on that type some things will change when building them.

Depending on the destination, the links are classically grouped as follows:

We will review all these types of links in the next articles of the .

Loading Facebook Comments ...
Loading Disqus Comments ...