How To Add A Link To A Page

Table of contents:

How To Add A Link To A Page
How To Add A Link To A Page

Video: How To Add A Link To A Page

Video: How To Add A Link To A Page
Video: 12: How to Create Links in HTML | Basics of CSS | Learn HTML and CSS | HTML Tutorial 2024, April
Anonim

Hyperlinks are a cornerstone of HTML (HyperText Markup Language). Actually, this language would not be needed if it were not for the possibility, by means of cross-references, to link the pages of documents located in different places into a single network. We will consider in more detail how to insert links into the html-code of your website pages.

How to add a link to a page
How to add a link to a page

Instructions

Step 1

Links, along with all other elements of the pages, are recreated by the browser based on the set of descriptions of these elements received from the server. These descriptions are presented in the form of html instructions describing the types, appearance and location of each image, link, text box, list, etc. These instructions are called "tags". The tag describing the link in html-code looks like this: Simple link - the opening tag of the link, then the text of the link, and then the closing tag Additional information about the appearance and properties of the link is placed in its opening tag and is called "attributes". In particular, the href attribute contains the address to which a request for a page or any other document should be sent when a visitor clicks this hyperlink. An address in this form (starting with "http") is called "absolute". It is not always necessary to indicate the full Internet address - if the requested page is located on the same server and in the same (or subfolder) folder, then only the page file name or the path to the subfolder is sufficient. These addresses are called "relative", and they look, for example, like this: Simple link

Step 2

That is, to add a link to any page, you should open its html-code and enter the appropriate tag in the right place. If you can operate with a file containing the page code on your computer, then any text editor will be enough for this. for example standard Notepad. And if the site is administered with the help of some kind of management system, then it must have a page editor to edit. In this case, you can change the page code directly in the browser, you just need to find this editor in the control panel and open the required page in it. Depending on the control system used, the editor may additionally have a visual editing mode - WYSIWYG (What You See Is What You Get - "what you see is what you get"). In this case, you will not need to edit the html code "manually". The page in this editing mode looks the same as on the site - just find the place you need for the link on it, write the text, select it and, by pressing the corresponding button on the editor panel, enter the link address.

Step 3

In the link tag, you can, in addition to the address, specify other information that tells the browser how to change its appearance and behavior. More often than others, it is necessary to specify the target attribute - it contains information about which window the new page should be loaded into. There are four values: _blank - to open the document indicated by the link, the browser must create a separate window; _self - the document must be loaded into the same window or frame. "Frame" - part of the browser window, if this page divides the window into several parts; _parent - if the page with the link was loaded from another window (or frame), then it does not have a "parent" window. In this case, the new document should be loaded by the browser into the parent window; _top - the new document should be loaded into the same window, on top of any frames (if any); For example: The link will be opened in a new window

Recommended: