HTML Anchors - chrisbitm/python GitHub Wiki

Anchor Tags, represented by the <a> Tag, are used to create Hyperlinks in a Webpage. They allow Users to navigate to other pages, websites, or even specific Sections within a Page.

Example

<a href="https://www.example.com" target="_blank" title="Click to visit Example" rel="noopener">
  Visit Example
</a>
  • <a> starts the Anchor.
  • href stands for Hypertext Reference. It is an Attribute use to create a Hyperlink to either a different portion of the same Page, different Website, or a different Page on the same website.
  • "https://www.example.com" should be replaced with the Page that you want as a Reference Point. This can be anything, such as a Video that you want others to see on YouTube. This Reference isn't displayed to Users.
  • target="_blank" opens the Page in a new Tab at the Top of your Browser.
  • title="Click to visit Example" creates a Rectangular Box and displays the text whenever the User hovers over the Hyperlink with their Mouse. This is also called a Tooltip.
  • rel="noopener" shows the Relationship between the Website that you are one compared to the one that you are going to go to. More on this below.
  • Visit Example should be replaced with whatever text you want to show. This Text will be Blue and Underlined by default.

Placeholder

<a href="#">Click Here</a>
  • If you are a Developer and creating a Website. You can use # as a Placeholder and replace Click Here with whatever Text you want to test to see how the Document will look. Since there is no URL specified, the Anchor will not redirect.

target

_self

This will open the new page or section in the same Tab on your Web Browser. In other words, you will be redirected from the Page that you were currently on. If you want to go back to it, you will have to Push the Back Button to go back to where you were at. If a target attribute is not specified. This is default.

_blank

This will open up a new page or section in a different tab on your Web Browser. This means that you can still view the Page that you were on before or while viewing whatever Website you were redirected to depending on the Content.

_parent (Used with FrameSets; Not Common)

_top (Used with FrameSets; Not Common)

title

This

rel

The rel Attribute in HTML Anchor Tags specifies the relationship between the current Document and the redirected one. It's especially useful for improving SEO, Security, and Accessibility.

nofollow

You are telling Search Engines not to pass any Link Equity (OR Rank) to the Linked Page. This is useful to preventing spam links in user-generated content. In other words, you are indicating to search engines that the link shouldn't influence ranking decisions.

<a href="https://example.com" rel="nofollow">Visit Example</a>

noopener

This is a Security Feature that helps protect your Website from potential vulnerabilities. When you use this attribute, it prevents the newly opened tab (via the target="_blank" attribute) from being able to access the window.opener property. This reduces the risk of the newly opened tab potentially manipulating the original page with malicious scripts.

⚠️ **GitHub.com Fallback** ⚠️