Lorem ipsum dolor sit amet, consectetur adipiscing elit. Assume our page has a div section with the id news. But you can also link to a section of the same page by linking to an element using its id. We have seen how to link to an external web page (website). Anchor Tag Uses with ExamplesĪlong with href, there are other vital attributes that make the anchor tag useful. We will see the examples of how to do all this below. You can also link another HTML element or a protocol (for example, sending email), and you can execute JavaScript using the href attribute. The value of the href attribute is usually a URL pointing to a web page (like the one above). You need to use the href attribute to link to another page. Let's use this anchor tag to link to a web page. The above anchor tag is a valid HTML tag, but it doesn't do much other than act as a placeholder. Like any other HTML tags, you use the following construct to create an anchor tag: My Website The anchor tag is also known as a HyperLink. The primary purpose of an anchor tag is to link one page to another page or to a section of the same page. If you like to learn from video content as well, this article is also available as a video tutorial here: □ What is the Anchor Tag in HTML? Anchors - An app to demonstrate anchor tags()
0 Comments
Leave a Reply. |