HTML internal links | Intro to HTML/CSS: Making webpages | Computer Programming | Khan Academy

HTML internal links | Intro to HTML/CSS: Making webpages | Computer Programming | Khan Academy


– Links are a great way of connecting one web page to another web page. But they can also connect
one part of a web page to another part of that same web page, especially on really long web pages, like for a Table of Contents. I’ve now added a bunch more information to this page so that I could give you a history of the web, and a history of HTML versions. And I think it’s enough content that it deserves a Table of Contents. And I’ve started one up here. Just an un-ordered list with list items with each
of the section titles. And I want to link each of the section titles
so you can click them and just go to that part of the page. To do that, I once again use the a tag. So, I’ll start by just wrapping this title, n-star and n-text for a. Now what should go as the h-ref of this link? Well we need to somehow tell the browser where to jump to in the web page. Some way of uniquely identifying that part of the page. If you’ve learned CSS selectors already, you’ve actually seen
how to do this, in fact. We can do it by adding an id attribute to a tag. Let’s scroll down and find the heading here and we’ll add an id
attribute to this heading. So I’m gonna put my cursor in h2 type id equals, and come up with a good
identifier that’s unique, like a web-history. Okay, let’s scroll back up to the link. And, now, in order to tell the browser to go to this internal link, we need to start with a hash sign and then type exactly the
id like we typed it below. Okay, so now, pause this talk through and try clicking the link. Go on, I will wait. Clicky, clicky, clicky,
clicky, clicky, clicky, clicky. Okay, did you see it
scroll down to the section? Then it worked! We can add more links like that by putting id attributes on every heading and making a tags that point at them. But I’ll leave that for you to try. The big thing to remember is that the ids must be unique because otherwise the browser won’t know where to jump to. So make them nice and descriptive.

Author: Kevin Mason

2 thoughts on “HTML internal links | Intro to HTML/CSS: Making webpages | Computer Programming | Khan Academy

  1. CLICKY

    CLICKY

    CLICKY

    CLICKY

    CLICKY

    CLICKY
    CLICKY
    CLICKY
    CLICKY

    CLICKY

    CLICKY

    CLICKY

    CLICKY

    CLICKY

    CLICKY

    CLICKY
    CLICKY

    CLICKY

    CLICKY

    CLICKY

    CLICKY

    CLICKY

    CLICKY

    CLICKY

    CLICKY

    CLICKY

    CLICKY

    CLICKY

    CLICKY

    CLICKY

    CLICKY

    CLICKY

    CLICKY

    CLICKY

    CLICKY

    CLICKY

    CLICKY

    CLICKY

    CLICKY

    CLICKY

    CLICKY

    CLICKY

    CLICKY

    CLICKY

    CLICKY

    CLICKY

    CLICKY

    CLICKY

    CLICKY

    CLICKY

    CLICKY

    CLICKY

    CLICKY

    CLICKY

    CLICKY

    CLICKY

    CLICKY

    CLICKY

    CLICKY

    CLICKY

    CLICKY

    CLICKY

    CLICKY

    CLICKY

    CLICKY

    CLICKY

    CLICKY

    CLICKY

    CLICKY

    CLICKY

    CLICKY

    CLICKY

    CLICKY

    CLICKY

    CLICKY

    CLICKY

    CLICKY

    CLICKY

    CLICKY

    CLICKY

    CLICKY

    CLICKY

    CLICKY

    CLICKY

    CLICKY

    CLICKY

    CLICKY

    CLICKY

    CLICKY

    CLICKY

    CLICKY

    CLICKY

    CLICKY

    CLICKY

    CLICKY

    CLICKY

    CLICKY

    CLICKY

    CLICKY

    CLICKY

    CLICKY

    CLICKY

    CLICKY

    CLICKY

    CLICKY

    CLICKY

    CLICKY

    CLICKY

    CLICKY

    CLICKY

    CLICKY

    CLICKY

    CLICKY

    CLICKY

    CLICKY

    CLICKY

    CLICKY

    CLICKY

    CLICKY

    CLICKY

  2. CLICKY

    CLICKY

    CLICKY

    CLICKY

    CLICKY

    CLICKY

    CLICKY

    CLICKY

    CLICKY

    CLICKY

    CLICKY

    CLICKY

    CLICKY

    CLICKY

    CLICKY

    CLICKY

    CLICKY

    CLICKY

    CLICKY

    CLICKY

    CLICKY

    CLICKY

    CLICKY

    CLICKY

    CLICKY

    CLICKY

    CLICKY

    CLICKY

    CLICKY

    CLICKY

    CLICKY

    CLICKY

    CLICKY

    CLICKY

    CLICKY

    CLICKY

    CLICKY

    CLICKY

    CLICKY

    CLICKY

    CLICKY

    CLICKY

    CLICKY

    CLICKY

    CLICKY

    CLICKY

    CLICKY

    CLICKY

    CLICKY

    CLICKY

    CLICKY

    CLICKY

    CLICKY

    CLICKY

    CLICKY

    CLICKY

    CLICKY

    CLICKY

    CLICKY

    CLICKY

    CLICKY

    CLICKY

    CLICKY

    CLICKY

    CLICKY

    CLICKY

    CLICKY

    CLICKY

    CLICKY

    CLICKY

    CLICKY

    CLICKY

    CLICKY

    CLICKY

    CLICKY

    CLICKY

    CLICKY

    CLICKY

    CLICKY

    CLICKY

    CLICKY

    CLICKY

    CLICKY

    CLICKY

    CLICKY

    CLICKY

    CLICKY

    CLICKY

    CLICKY

    CLICKY

    CLICKY

    CLICKY

    CLICKY

    CLICKY

    CLICKY

    CLICKY

    CLICKY

    CLICKY

    CLICKY

    CLICKY

    CLICKY

    CLICKY

    CLICKY

    CLICKY

    CLICKY

    CLICKY

    CLICKY

    CLICKY

    CLICKY

    CLICKY

    CLICKY

    CLICKY

    CLICKY

    CLICKY

    CLICKY

    CLICKY

    CLICKY

    CLICKY

    CLICKY

    CLICKYCLICKY

    CLICKY

    CLICKY

    CLICKY

    CLICKY

    CLICKY

    CLICKY

    CLICKY

    CLICKY

    CLICKY

    CLICKY

    CLICKY

    CLICKY

    CLICKY

    CLICKY

    CLICKY

    CLICKY

    CLICKY

    CLICKY

    CLICKY

    CLICKY

    CLICKY

    CLICKY

    CLICKY

    CLICKY

    CLICKY

    CLICKY

    CLICKY

    CLICKY

    CLICKY

    CLICKY

    CLICKY

    CLICKY

    CLICKY

    CLICKY

    CLICKY

    CLICKY

    CLICKY

    CLICKY

    CLICKY

    CLICKY

    CLICKY

    CLICKY

    CLICKY

    CLICKY

    CLICKY

    CLICKY

    CLICKY

    CLICKY

    CLICKY

    CLICKY

    CLICKY

    CLICKY

    CLICKY

    CLICKY

    CLICKY

    CLICKY

    CLICKY

    CLICKY

    CLICKY

    CLICKY

    CLICKY

    CLICKY

    CLICKY

    CLICKY

    CLICKY

    CLICKY

    CLICKY

    CLICKY

    CLICKY

    CLICKY

    CLICKY

    CLICKY

    CLICKY

    CLICKY

    CLICKY

    CLICKY

    CLICKY

    CLICKY

    CLICKY

    CLICKY

    CLICKY

    CLICKY

    CLICKY

    CLICKY

    CLICKY

    CLICKY

    CLICKY

    CLICKY

    CLICKY

    CLICKY

    CLICKY

    CLICKY

    CLICKY

    CLICKY

    CLICKY

    CLICKY

    CLICKY

    CLICKY

    CLICKY

    CLICKY

    CLICKY

    CLICKY

    CLICKY

    CLICKY

    CLICKY

    CLICKY

    CLICKY

    CLICKY

    CLICKY

    CLICKY

    CLICKY

    CLICKY

    CLICKY

    CLICKY

    CLICKY

    CLICKY

    CLICKY

    CLICKY

    CLICKYCLICKY

    CLICKY

    CLICKY

    CLICKY

    CLICKY

    CLICKY

    CLICKY

    CLICKY

    CLICKY

    CLICKY

    CLICKY

    CLICKY

    CLICKY

    CLICKY

    CLICKY

    CLICKY

    CLICKY

    CLICKY

    CLICKY

    CLICKY

    CLICKY

    CLICKY

    CLICKY

    CLICKY

    CLICKY

    CLICKY

    CLICKY

    CLICKY

    CLICKY

    CLICKY

    CLICKY

    CLICKY

    CLICKY

    CLICKY

    CLICKY

    CLICKY

    CLICKY

    CLICKY

    CLICKY

    CLICKY

    CLICKY

    CLICKY

    CLICKY

    CLICKY

    CLICKY

    CLICKY

    CLICKY

    CLICKY

    CLICKY

    CLICKY

    CLICKY

    CLICKY

    CLICKY

    CLICKY

    CLICKY

    CLICKY

    CLICKY

    CLICKY

    CLICKY

    CLICKY

    CLICKY

    CLICKY

    CLICKY

    CLICKY

    CLICKY

    CLICKY

    CLICKY

    CLICKY

    CLICKY

    CLICKY

    CLICKY

    CLICKY

    CLICKY

    CLICKY

    CLICKY

    CLICKY

    CLICKY

    CLICKY

    CLICKY

    CLICKY

    CLICKY

    CLICKY

    CLICKY

    CLICKY

    CLICKY

    CLICKY

    CLICKY

    CLICKY

    CLICKY

    CLICKY

    CLICKY

    CLICKY

    CLICKY

    CLICKY

    CLICKY

    CLICKY

    CLICKY

    CLICKY

    CLICKY

    CLICKY

    CLICKY

    CLICKY

    CLICKY

    CLICKY

    CLICKY

    CLICKY

    CLICKY

    CLICKY

    CLICKY

    CLICKY

    CLICKY

    CLICKY

    CLICKY

    CLICKY

    CLICKY

    CLICKY

    CLICKY

    CLICKY

    CLICKY

    CLICKYCLICKY

    CLICKY

    CLICKY

    CLICKY

    CLICKY

    CLICKY

    CLICKY

    CLICKY

    CLICKY

    CLICKY

    CLICKY

    CLICKY

    CLICKY

    CLICKY

    CLICKY

    CLICKY

    CLICKY

    CLICKY

    CLICKY

    CLICKY

    CLICKY

    CLICKY

    CLICKY

    CLICKY

    CLICKY

    CLICKY

    CLICKY

    CLICKY

    CLICKY

    CLICKY

    CLICKY

    CLICKY

    CLICKY

    CLICKY

    CLICKY

    CLICKY

    CLICKY

    CLICKY

    CLICKY

    CLICKY

    CLICKY

    CLICKY

    CLICKY

    CLICKY

    CLICKY

    CLICKY

    CLICKY

    CLICKY

    CLICKY

    CLICKY

    CLICKY

    CLICKY

    CLICKY

    CLICKY

    CLICKY

    CLICKY

    CLICKY

    CLICKY

    CLICKY

    CLICKY

    CLICKY

    CLICKY

    CLICKY

    CLICKY

    CLICKY

    CLICKY

    CLICKY

    CLICKY

    CLICKY

    CLICKY

    CLICKY

    CLICKY

    CLICKY

    CLICKY

    CLICKY

    CLICKY

    CLICKY

    CLICKY

    CLICKY

    CLICKY

    CLICKY

    CLICKY

    CLICKY

    CLICKY

    CLICKY

    CLICKY

    CLICKY

    CLICKY

    CLICKY

    CLICKY

    CLICKY

    CLICKY

    CLICKY

    CLICKY

    CLICKY

    CLICKY

    CLICKY

    CLICKY

    CLICKY

    CLICKY

    CLICKY

    CLICKY

    CLICKY

    CLICKY

    CLICKY

    CLICKY

    CLICKY

    CLICKY

    CLICKY

    CLICKY

    CLICKY

    CLICKY

    CLICKY

    CLICKY

    CLICKY

    CLICKY

    CLICKY

    CLICKY

    CLICKY

    CLICKYCLICKY

    CLICKY

    CLICKY

    CLICKY

    CLICKY

    CLICKY

    CLICKY

    CLICKY

    CLICKY

    CLICKY

    CLICKY

    CLICKY

    CLICKY

    CLICKY

    CLICKY

    CLICKY

    CLICKY

    CLICKY

    CLICKY

    CLICKY

    CLICKY

    CLICKY

    CLICKY

    CLICKY

    CLICKY

    CLICKY

    CLICKY

    CLICKY

    CLICKY

    CLICKY

    CLICKY

    CLICKY

    CLICKY

    CLICKY

    CLICKY

    CLICKY

    CLICKY

    CLICKY

    CLICKY

    CLICKY

    CLICKY

    CLICKY

    CLICKY

    CLICKY

    CLICKY

    CLICKY

    CLICKY

    CLICKY

    CLICKY

    CLICKY

    CLICKY

    CLICKY

    CLICKY

    CLICKY

    CLICKY

    CLICKY

    CLICKY

    CLICKY

    CLICKY

    CLICKY

    CLICKY

    CLICKY

    CLICKY

    CLICKY

    CLICKY

    CLICKY

    CLICKY

    CLICKY

    CLICKY

    CLICKY

    CLICKY

    CLICKY

    CLICKY

    CLICKY

    CLICKY

    CLICKY

    CLICKY

    CLICKY

    CLICKY

    CLICKY

    CLICKY

    CLICKY

    CLICKY

    CLICKY

    CLICKY

    CLICKY

    CLICKY

    CLICKY

    CLICKY

    CLICKY

    CLICKY

    CLICKY

    CLICKY

    CLICKY

    CLICKY

    CLICKY

    CLICKY

    CLICKY

    CLICKY

    CLICKY

    CLICKY

    CLICKY

    CLICKY

    CLICKY

    CLICKY

    CLICKY

    CLICKY

    CLICKY

    CLICKY

    CLICKY

    CLICKY

    CLICKY

    CLICKY

    CLICKY

    CLICKY

    CLICKY

    CLICKY

    CLICKY

    CLICKY

    CLICKY

Leave a Reply

Your email address will not be published. Required fields are marked *