HOME C C++ PYTHON JAVA HTML CSS JAVASCRIPT BOOTSTRAP JQUERY REACT PHP SQL AJAX JSON DATA SCIENCE AI

HTML Links

In HTML, the <a> (anchor) element is used to create links or hyperlinks. A hyperlink is a reference to another document, resource, or location on the web. When a user clicks on a hyperlink, it typically navigates them to the linked destination. Here's the basic syntax of an HTML link:

Example

             
<a href="url"> link text </a>  
You can click on above box to edit the code and run again.

Output

Linking to Another Web Page:

Linking to another web page using HTML involves using the <a> (anchor) element with the href attribute set to the URL of the target page. Here's an example

Example

            
<a href="https://www.codelines.in"> Codelines </a> 
You can click on above box to edit the code and run again.

Output

Linking with an Image:

To use an image as a link, just put the <img> tag inside the <a> tag:

Example

            
<a href="https://www.codelines.in">
<img src="codelines.jpg" alt"codeline image">
</a>
You can click on above box to edit the code and run again.

Output

Example

            
<a href="https://www.codelines.in"> Codelines </a>
You can click on above box to edit the code and run again.

Output