Aug 30, 2026

Introduction: Anchor Tag | Link Tag

Link Tag and Attribute

📝 Web documents have link (or hyperlink) that take you from one web page to another. 

Links are created using an <a> element (the a stands for anchor). 

 For example, 

<p>< a href="bapispage.blogspot.com" > Click here to visit Bapis Page.</a></p> 

In the above paragraph, the < a > element that creates the link. Between the opening <a> tag and the closing </a> tag is the text that you can click on, which says “Click here to visit Bapis Page.” 

In this case, it's the href attribute; this is followed by an equal sign, and then a pair of quotation marks which contain the URL (https://www.bapispage.blogspot.com, it's value) for "Bapis Page". 

If you wanted the link to open in a new window, use target attribute  and the value is "_blank. 

E.g.  

< a href="https://www.bapispage.blogspot.com" target="blank"> 

📝 This illustrates that elements can carry several attributes, although an element should never have two attributes of the same name. 

No comments:

Post a Comment

Thank you to visit Bapi's Page.