Work with links
Work with links
Has anyone seen a site without links? Yes, it sounds funny. We will not tell what it is, anyone who has visited the Internet at least once knows about them, but we will show you how to install them on the page.
Any link in the HTML language is indicated by a <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 that are visible in the browser when you click the mouse.
- LINK , ALINK , VLINK - color of links depending on mouse hover. Used in cascading style sheets or directly in the <BODY> tag .
The HREF attribute in HTML code is written according to the general rules - immediately after the tag through a "space" . In the value you need to specify the "place" where we will refer. Further, the link text is entered in the <A> tag container itself. If you want to send a link to another site, then you need to specify in the value of its full address on the Internet. Example:
<A HREF="http://www.vesty.ru> News </A>
For local use between pages, a link is made directly to the page itself, indicating the file extension. Since site on the server is; The "tree" of folders - there are some differences. This is what an entry in the HTML code will look like if we link to a page in the same folder :
<A HREF = "index.shtmll"> Home </A>
If the page you are looking for is located in subfolders relative to the page where the link is located, then everything is a little different:
<A HREF=" subfolder name / search page name"> link text </A>
When linking to another tree folder , the following method is used: in the code, the "../" character set is specified for each tree level relative to the folder where the link with the folder name is specified (if there are no subfolders) or only subfolders (if the page is there ). Example - the required page is in a folder two levels up, nested in a subfolder:
<A HREF= "../../ name of subfolders/ name of the page you are looking for> link text </A>
The same principles make links to any other file.
The link object may be part of a document of another or current page. To do this, you first need to put a "label" in the page code (using the attributes ID or NAME ) where the link will be produced. The link itself will be addressed to this "tag." Example - assign the name of the part of the document where the link will be produced:
<A NAME=" label name "> </A> , then make a link with the name and address of the label. Like this: <A HREF = "address # tag name"> link text </A>
Note: Pay special attention to the "#" symbol - it is required . When linking to the current page, the address is not specified.
A link to the mailbox address should be produced as follows:
<A HREF=" mailto: mailbox address "> link text </A>
In addition to text, the object in the form of a link can be any image. To do this, just simply put the code of this image in the container <A> </A> instead of text . Example:
<A HREF=" index.shtmll ">
<IMG SRC = "img / home.gif" ALT = "Home" WIDTH = "16" HEIGHT = "16" BORDER = "0"> </A>
This is all related to the links. To consolidate the topic - you need training on your PC.