Anchors & Attributes

Create links on your web page!

*Tip: Try having a notepad and writing down what you learn!

Back
Download Notes

Now we can create elements that actually help link our pages in our website, or provide links to other websites! The information called "attributes" must be written in the opening tag.

Main Points:

  1. An "anchor" element is written like a normal text element
  2. However an anchor requires an "attribute" to work, which is written in the opening tag.
  3. "href" stands for "Hyper-Link Reference" and tells us where this anchor will take us.
  4. "href" and "target" are both attributes and must be written in the opening tag.
// This will take us to Apple.com, but will replace our website
<a href="http://www.apple.com">Take me to Apple</a>

//This will take us to YouTube.com in a new tab on our browser
<a href="http://www.youtube.com">Take me to YouTube</a>

**If you havent set up your website yet please watch the first videos under "Setting Up".

Sign Up