FAQ: Learn HTML - Common HTML Elements - Linking to Same Page

Welcome to the forums!

Please post your code using the </> button to format it. You can also see the hint for step 2, it provides an example of what your code should look like.

Correct code:

12   <ul>
13         <li><a href="#introduction">Introduction</a></li>
14         <li><a href="#habitat">Habitat</a></li>
15         <li><a href="#media">Media</a></li>
16    </ul>
17     <div id="introduction">
...
1 Like

i tryed with lowercase , but still have the same error , any solutions
thank you .

Press the get solution button.

We should always strive to solve problems without looking directly at the answer unless we have exhausted all other options. Otherwise, what do we learn or take away from the exercise?

@hichamboudza42260334, welcome to the forums! Please post your code (and format it using the </> button) so that we can take a look at what may have gone wrong.

Their code was exactly correct, though. They are replying to post 32, which I suspect is their code, but lowercase. (He/She said the code is now lowercase.)

Can someone explain why they use the id tag on the first example in the article, but then use the href id in the second example? I understand that href provides a link to the target site on the page, but what does id do since it doesn’t provide a link as well?

id does provide a link by way of being a global object that can be hooked.

<a href="#page_fragment">Page Fragment</a>

<div id="page_fragment">

</div>

Can you use them interchangeably? I don’t believe I’ve gotten that far in the lesson so I’m not sure what hooked means yet.

My term. It means anything that a URL reference can be attached to.

1 Like

Upon loading this lesson I am getting an “Unable to connect to Codecademy. Refresh the page to connect.” message.
I have refreshed numerous times, over several days. I am able to connect to all previous lessons and other courses. I even tried from Windows and Apple devices resulting in the same error.

Upon having gone into the Inspect tool > Console > I found the follow errors with line 2 displaying in red on the page.

  1. [Facebook Pixel] - Duplicate Pixel ID: 1036078779778355. connect.facebook.net/en_US/fbevents.js:23

  2. Uncaught (in promise) Get “”: unsupported protocol scheme “” linking-same-page-html:1

  3. DevTools failed to load SourceMap: Could not load content for chrome-extension://fheoggkfdfchfphceeifdbepaooicaho/sourceMap/chrome/iframe_handler.map: HTTP error: status code 404, net::ERR_UNKNOWN_URL_SCHEME

  4. DevTools failed to load SourceMap: Could not load content for chrome-extension://fheoggkfdfchfphceeifdbepaooicaho/sourceMap/chrome/content.map: HTTP error: status code 404, net::ERR_UNKNOWN_URL_SCHEME

Please advise when this will be resolved or how to resolve it

Every time I type the < before the A in the it comes up as an error. Any reason for this?
Screen Shot 2021-03-15 at 10.56.04 AM

most html elements consist of an opening tag:

<a>

and a closing tag:

</a>

we can add attributes to opening tags:

<a href="#">

where you go wrong, is that your opening tags are not close properly. The > is missing.

looking at the colors in the editor, you can see the text (which should be white) is green.

you can also hover your mouse over the red errors to get more information.

I get the opening tag idea, but when I start to type an anchor tag the with the < sign the error pops up immediately. Saying “special characters must be escaped.”

Because the opening tag wasn’t properly closed.

Got it!

Thank You for your help.

Oof parchance c’est un peu difficile de demandez des question ici en francais. Mais c’etais quoi exactement votre problem sur exercise 10? Je sais ca fais quelque mois que vous avez deja demadez …

Translate: It might be difficult to get your questions answered here in french but Ill try… What exactly was your problem on exercise 10? I know its been a couple of months since you asked…

Yeah I’m with you the red is annoying… I think its supposed to be a UI interface feature but it feels more like an error than a helpful feature. Though I’m not sure it’s trying to indicate an error per say just that you opened a tag? IDK … but if it helps even programs like Visual Studio even if you are taking your time writing something out will flag it as an error.

This is more of a comment than anything else… but they should probably tell you the ‘#’ is a placeholder for when you don’t have the link you want to insert yet… and also the div id’s are what makes the whole exercise work. I think they should probably explain that first.

Their question/comment was from February 2019 and was not specific enough anyways (just saying they were able to pass #10 without including something). For future reference, there’s no need to reply to comments from a long time ago (I’d say anything more than a month or two) just because it’s likely the user either won’t see it or will have already solved the problem.