KandZ – Tuts

We like to help…!

HTML 8 – Comments and anchor element in HTML

Comments and anchor element

Comments

<!-- This is a comment -->
<p>This is some text</p>

<!--
<p>This is another text</p>
-->
  • Comments are important, they help improve the readability of the code
  • You can use them leave notes about your code
  • You can also use them to temporarily disable parts of the code
<a href="https://www.google.com>Click here to visit Google</a>
<a href="7.html">Lesson 7</a>
<a href="7.html" target="_blank">Lesson in a new tab/window</a>
<a title="Send email to me" href="mailto:me@example.com">Send email</a>
  • Anchor element creates hyperlinks and by clicking them you be taken to another webpage/website
  • It can contain other elements like text and images
  • href attribute specifies the webpage/website that the user will be redirected
  • it can take absolute(https://www.google.com) or relative url(a webpage within the same document -> 7.html)
  • target attribute specifies where the new webpage will be opened
  • target values can be _self(default same tab/window, _blank(new tab/window), _parent(in the parent frame), _top(in the full body of the window)
  • mailto: inside href attribute will open user’s default email client/program
  • title attribute shows more information about any element, not only the anchor element

Leave a Reply