Hyperlinks tags

Coding (Html5)

Sep 30, 2017

How did the WWW become so popular using hyperlinks
 
/img/blog/hyperlinks-tags.jpg

 

One of the features that made the fortune of the web is that, it is being formed not by words, but by hypertexts (another of the features that have made the Web is undoubtedly the ability to interact, but that's another story).

 

 

The links are "the bridge" that allows you to switch between text.

 

 

As such, the links are formed by two components:

 


    
        
            
            
        
        
            
            
        
        
            
            
        
    

 

The content The Resource
It is the visible part of the link, and that is why the user should always be able to understand what links to click within the page This is another page (on the same server or on a different server), or it is an internal connection to a location on the page itself
"Hides" the connection (whether it's text or image) It indicates the direction which you are linking

 

 

Links pointing to other documents

 

 

Here is the syntax to create a link with reference to a web site:

 

 

The content developers are on

 

 

Click here!  

 

 

 

 

 

As you can guess the head of our anchor is the '"Click here!" text, while the tail, that is the destination (specified by the href attribute) is the website to which the link points,

 

 

 

 

 

It is immaterial whether the anchor target is an web page of a site, an image, a PDF file, a zip file, or an .exe file: the link mechanism works the same regardless of the type of resource;

 

 

Then the browser will behave differently depending on the resource.

 

 

 

 

 

You can, for example, specify an email address as a link. In this case it can open the user's mail client with the email address pre-set.

 

 

The syntax is as follows:

 

 

Send email an email!

 

 

 

 

 

 

 

 

The Ancor

 

 

We can take advantage of the link mechanism also to create an internal index to the document, using anchors. Each anchor may have indeed an id:

 

 

 

 

 

Example

 

 

Go to the Paragraph One

 

 

 

This is the Paragraph One

 

 

 

 

 

 

As we just see in the above example it is possible to refer the anchor inside the document via a link that points to it

 

 

 

 

 

The hash indicates that the link should look for an anchor within the page itself.

 

 

If it does not specify the name of the anchor to aim at, it still creates a link pointing to top of the document (it is searched an anchor whose name is not specified).

 

 

 

 

 

This fact is a great ploy to create empty links (in some cases are helpful).

 

 

empty link

 

 

 

 

 

To create an internal index to the page thus proceeds in two distinct phases:

 

 


  1.     
  2. Creating anchor to aim (

    )


  3.     
  4. Creation of the anchor connection you just created and reference through the hash ()



  5.  
  6.  

 

 



Before the arrival of HTML5 instead of the id was possible to add the attribute 'name', even though this practice is not deprecated yet, it is better to indicate the anchor via id because the document with a text/html MIME type parse the id before the name.

 

 

 

 

 

 

 

 

If you like the content of this page, please, do not forget to share with your friends using the button at the top right of the navigation; if you have something else to say about this topic or you think i missed some important part, contact me and I will add it citing you.

 

 

 


 

 

 

 

 

 

 

 

 

 

Ever thought on learning some server-side language?
Check out my reviews of 24 of the most popular PHP framework currently available

 
 
If you like this content and you are hungry for some more join the Facebook's community in which we share info and news just like this one!
 

Other posts that might interest you

Coding (Html5) Jan 14, 2018

Insert images in your document

See details
Coding (Html5) Jan 14, 2018

Build your foundation

See details
Coding (Html5) Jan 14, 2018

History of Web Layouts

See details
Get my free books' review to improve your skill now!
I don't want to improve