HTML Links

  • HTML links are hyperlinks.
  • Links will take you to another webpage or files in another website or in the same website.
  • We can hide a link in a text or image.
  • tags are used to define hyper links in html.

Syntax :



  <a href="url">link text</a>
          

herf attribute used to specify the link.
The text we want to show instead of link is specified between <a> </a> tags.




  <a href="www.google.com">Google</a>

                             

Output:


Instead of text,we can use images as links./p>

How to set image as link :

We can use a <img> tag to specify the the image which we want to make image link.



  <a href="www.google.com"><img src="img/google.png"> </a>

 			

Output:



Try clikcing on the image, and it will redirect you to Google.com

External and Internal Links :

  • External links leads to another website.
  • Internal links leads to the same website or specific location in the same webpage.

External Links Example:



  <a href="https://www.yahoo.com/">yahoo</a>
  <a href="https://www.google.com/">Google</a>

                 

Example of Internal Links:



  <a href="html_explaned .asp">HTML Explaned</a>
  <a href="/css/Started.asp">CSS Get Started </a>