The Anatomy of an HTML Tag


Reference

<p>
Want to search the web?
Try <a> href="https://google.com" id="the-best-link" class="banana" target="_blank">Google </a>
</p>

Reference Explained

Tags Used:

Tag Name Reference #1 Reference #2
<p> </p> Paragraph tag <p>: The Paragraph element - HTML: HyperText Markup Language | MDN (mozilla.org) HTML p tag (w3schools.com)
<a> </a> Anchor tag <a>: The Anchor element - HTML: HyperText Markup Language | MDN (mozilla.org) HTML a tag (w3schools.com)

Relationships:

  • <a> is the child of <p>
  • <p> is the opening tag of </p>. </p> is the closing tag of <p>. <p> Begins a paragraph while </p> ends the paragraph

Attributes:

Attribute Value Purpose
href https://google.com Linked document or website
id the-best-link ID used for css. Most specific unique identifier
class banana Class used for css. There can be multiple of the same class
target _blank _blank allows the linked object to be opened in a new tab. You can specify if it will open in the same tab, different tab, new window and other options.