How to make a link to the site.

How to make a link to the site.

How to make a link to the site.

All pages on the Internet are linked. Links are the most important component of the entire Internet, without which its existence today is simply not possible. We’ll look at how links are created, what kinds of links are created, and how to make a link from any image.

 

Link in html is defined using an <a> tag and its pair closing tag </a>. The reference address is specified using the href= “”attribute. For example, the link code for this site would look like this:
<a href= “http://best-news.pro/” >create sites.< / a>
A link consists of two elements:

 

– href= reference addresses http://best-news.pro/ and

 

— text links to the site.

 

In the parameter href= we have written the address of the page, and between the tags <a> and </a> we have to write the text by clicking on which to click on the link.

 

The text of the link is called anchor or anchor links. We reviewed an example of a link that leads to the main page of the site. In this case, in the link address, we did not specify the file name and its extension. In order to give a link to the main page of the site is enough to specify the address of the site. In most cases, the home page is named index.html.

 

Any picture can be used instead of text. Then clicking on the picture will also be made by clicking on the link.
<html>
the <head>
<title>My first web page in just 5 minutes< / title>
< / head>
<body bgcolor= “#00CCFF “text= ” #FFFF00″>
the <center>
Today is a wonderful day. <br><i > I made my first Internet page.< / i>
<br><font color= “#0000FF”size=”4″ ><b>I will be a happy person!< / b>< / font>
<br><br>
<a href=”http://best-news.pro/” ><img src= ” best-news.jpg ” >< / a>
<br><br>
<a href=”http://best-news.pro/” > Site about creating sites.< / a>
< / center>
< / body>
< / html>
In some browsers, such as Internet Explorer, around the picture will be painted border frame. To remove this effect, you need to specify that the picture should not have a border frame. Is done this is so:
<img src= ” best-news.jpg “border= “0”>
To open a link in a new window, add another parameter to the <a>tag
<a href=”http://best-news.pro” target= “_blank”>
Total, the code of our page will be like this
<html>
the <head>
<title>My first web page in just 5 minutes< / title>
< / head>
<body bgcolor= “#00CCFF “text= ” #FFFF00″>
the <center>
Today is a wonderful day. <br><i > I made my first Internet page.< / i>
<br><font color= “#0000FF”size=”4″ ><b>I will be a happy person!< / b>< / font>
<br><br>
<a href=”best-news.pro” ><img src= “best-news.jpg “border=” 0 ” >< / a>
<br><br>
<a href=”best-news.pro” target=”_blank” >Site about creating sites.< / a>
< / center>
< / body>
< / html>

 

How to make a link to the file. Just like other links, just by specifying a file name in the destination. You can reference not only files with an html extension, but also files with other extensions. To do this, specify the appropriate file name and extension in the link address. For example:
<a href=”popsa.mp3 ” >Download song< / a>

 

<a href=”arhiv.rar ” >Download program< / a>

All links that we have reviewed previously are external. Besides them there are also internal links. Internal links are used to navigate within a single open document. This may be useful if, for example, you decide to create one large document and place the contents at the top of it. Or you just need to quickly direct the visitor to any part of your page.

 

Suppose we need to make such a link by clicking on which the visitor will get to the top of this page. To do this, the first word or phrase on this page must be enclosed in the tag <a name=””>the first word</a>. Where quoted, you must specify any name.

 

For example, for the page where you are now, you can do so:
<a name= “verh”>All pages< / a>
We identified the anchor, i.e. the place where you will get the user clicking on our link. Now, in the place where you need it, you must specify the link itself. Is done this is so:
<a href= “# verh ” >Go up< / a>
Note that here in quotation marks before the word verh must be the pound sign #.

 

What are the different types of links.

The following types of links, absolute and relative. Absolute references are references that specify the full address of the document. These links are used to communicate with external network resources. An example of such links:
<a href= “http://yandex.ru /” >Search engine.< / a>
A relative link is a link that does not have a common address part. Such links are used within the same site. An example of such links:
<a href= “index.html” > Home page< / a>
/
/ demo/
These two links are called incomplete and instruct the web server to load the index file.html (or default.html), which is located in the root of the site or demo folder. If the index file.html is missing, the browser usually shows a list of files in this directory.
/images / pic.gif
The slash before the address it says that the addressing starts from the root of the site. The link leads to the picture of pic.gif, which is located in the images folder. And that, in turn, is placed in the root of the site.
../ help / me.html
A colon before the name instructs the browser to move to a level higher in the site directory list.
manual / info.html
If there are no additional characters before the folder name, such as a colon, it is placed inside the current directory.

 

Sometimes you can find the address link in the path ./file / doc.html. A point with a slash ( / ) indicates that the count is from the current folder. This entry is redundant and can be reduced to a file/doc.html.

 

A little bit about the protocols.

 

http:/ / — the most common Protocol, using it provides access to web pages, the link looks like this:
<a href= “http://yandex.ru /” >Search engine.< / a>
mailto: – email access Protocol. It must be used if you want to give a link to an email. The reference code is written as follows:
<a href= “mailto:адресс@почты.ru” >Send email< / a>
In addition to these protocols, there is another Protocol ftp://, with which, the transfer of files via FTP using the FTP client program. The file:// — Protocol is also used to specify a link to a page located on the local computer.

 

How to make a link to the site.

Spread the love

Leave a Reply

Your email address will not be published. Required fields are marked *