HTML Basics 5: Links


I’ve noticed that when I paste a URL into my code, it appears like regular text rather than a clickable link. How come?

Your issue is that you aren’t utilizing the <a> tag. How to do so?

Similarly to <img>, you’ll put the link inside the brackets. But unlike <img>, it’s not a self-closing tag. To insert a link, you’ll need to do this:

<a href="https://gunvolt.com"><p>This here is a link to the Gunvolt portal site!<p></a>

And your result is:

This here is a link to the Gunvolt portal site!

You’ll notice that rather than “src” you write “href.” Why that is, I have no clue. But does it matter why you do it? I don’t really… think so. All you need to do is remember to use “href” rather than “src” for the <a> tag.

You can also choose where this link opens! Your four options are:

  1. _blank
  2. _self
  3. _parent
  4. _top

But “_blank” is the only one I know how to use… you’ll use it often too if you link back to sites on your own via buttons. “_blank” opens links up in a new tab.

Here’s how to use it:

<a href="https://gunvolt.com" target="_blank"><p>his here is a link to the Gunvolt portal site!<p></a>

And it comes out like this:

This here is a link to the Gunvolt portal site!

Not only do you use <a> for text, but for images and list items too.

For example, a linked image can be made like so:

<a href="https://youtu.be/thZWIzhnv_k?si=MXIA6uemvvVQq_cY"><img src="https://files.catbox.moe/pin7dw.gif/></a>

ENTRY GLOSSARY:


Continue to: HTML BASICS 6: Customizing Your Text with Tags

Return to: HTML Basics 4: Alt vs Title