This page has been robot translated, sorry for typos if any. Original content here.

Working with links

Working with links

Has anyone seen the site without links? Yes, it sounds funny. We will not tell you what it is, anyone who has at least once visited the Internet knows about them, and we'll show how to install them on the page.

Any reference in the HTML language is indicated by the <A> tag, which has the following attributes:

  • HREF - addressing
  • ID or NAME - internal address of the document part
  • TARGET - shows in which window the link will be opened. (values ​​are _blank (new), _self (current), _top, and _parent.
  • TITLE - comments to the link, which are visible in the browser when the mouse is guided.
  • LINK , ALINK , VLINK - the color of the links, depending on the mouse's hover. Used in cascading style sheets or directly in the <BODY> tag .

The attribute HREF in the HTML-code is written according to the general rules - immediately after the tag through the "blank" . In the value you need to specify the "place" to which we will refer. Next, in the container of the <A> tag, the link text is entered. If you want to send a link to another site, you need to specify the value of its full Internet address. Example:

<A HREF="> News </A>

When used locally between pages, the link is made directly to the page itself, indicating the file extension. Because The site on the server is itself; "tree" of folders-there are some differences. This will look like an entry in the HTML code, if we refer to the page in the same folder :

<A HREF = "index.shtmll"> Home </A>

If the page you are looking for is in a subfolder , relative to the page where the link is located, then everything is slightly different:

<A HREF=" subfolder name / search page name> > link text </A>

When referring to another "tree" folder , the following method is used: the "../" character set is indicated in the code for each level of the "tree" relative to the folder where the link with the folder name is located (if there are no subfolders) or only subfolders (if the page is there ). Example - the page you are looking for is in a folder on two levels up, nested in a subfolder:

<A HREF= "../../ the name of the subfolder / the name of the page you are looking for> the text of the link </A>

By the same principles, links are made to any other file.

A reference object can be a part of a document of another or the current page. To do this, you first need to put a "mark" in the page code (using the ID or NAME attributes) where the link will be made. The link itself will be addressed to this "label". Example - assign the name of the part of the document to which the link will be made:

<A NAME=" label name "> </A> , then make a link with the name and address of the label. Here's how: <A HREF = "address # tag name"> link text </A>

Note: Pay special attention to the symbol "#" - it is mandatory . When referring to the current page, the address is not specified.

The link to the address of the mailbox should be done like this:

<A HREF=" mailto: mailbox address "> text for link </A>

In addition to text, the object in the form of a link can be any image. To do this, just put the code of this image in the container <A> </A> instead of the text . Example:

<A HREF=" index.shtmll ">

<IMG SRC = "img / home.gif" ALT = "Home" WIDTH = "16" HEIGHT = "16" BORDER = "0"> </A>

That's all about the links. To fix the topic - you need training on your PC.