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

But I did that and it still won’t let me go on.

Please post a link to the exercise so we can determine what is expected.

  <h1>The Brown Bear</h1>
  <ul>
    <li><a href="#introduction">Introduction</a></li>
    <li><a href="#habitat">Habitat</a></li>
    <li><a href="#media">Media</a></li>
  </ul>

i have an error , why ?

1 Like

I have the same problem :roll_eyes:

1 Like

hmm I can’t reproduce the error you’re getting… What’s the error message?

Also, there a couple different troubleshooting things you can do, such as restarting your web browser, copy & pasting your code and restarting the exercise, and trying it(if you’re not already) in the Chrome web browser

1 Like

for its work now , since today = ) try

1 Like

I couldn’t get this to work either, no idea why. When I compared the solution code with my own, I noticed I capitalised Introduction etc, whereas the answer did not. Maybe that’s it?

3 Likes

It’s recomended to use the id attribute for HTML5 instead of the older name attribute?

sounds like an excellent question for documentation:

https://developer.mozilla.org/en-US/docs/Web/HTML/Element/a#Obsolete_attributes

1 Like

This was giving me trouble forever! I got one to work, the intro, but the rest of the code wouldn’t work for whatever reason. So, I just copy/pasted the line that worked and then changed the names.

1 Like

https://www.codecademy.com/courses/learn-html/lessons/common-html-elements/exercises/linking-same-page-html?action=resume_content_item here’s the link

1 Like

Can’t get past exercise # 2. Look at the error message. It appears that the error message does not apply to me. I did as the error message instructed me to do. Did I miss something? Is it a bug?

#Introduction, #Habitat, #Media the first letter of each of these are uppercase you need to make them lowercase as well as the div names, the lesson checker is seeing its uppercase and doesn’t know that you also specified the div names with uppercase, when doing the lessons here just follow the instructions as is as its all case sensitive and very particular with following the instructions to the T, when you are working on your own you can use uppercase or lowercase in classes/ID’s as you wish

4 Likes

Thanks, it’s fixed. I did as you instructed.

1 Like

i made everything lowercase and it worked, but for some reason it still isn’t saying that i did it correctly despite the fact that it’s working just fine
Edit: the yellow text needs to be lowercase, but the white text needs the beginning to be uppercase

2 Likes

For future people that see this, the reason is the capitalization in the href= it wants lowercase not uppercase.

4 Likes

I was wondering that… I typed everything right but noticed I capitalized “#Introduction” … Apparently it doesn’t like that.

Hey @garrison001, welcome to the forums!

Yes, one thing you have to make sure about these lessons is that you get all the terms correct. I mean, if you were coding an actual project then that one capitalized “I” would’ve been pretty annoying, especially if you didn’t notice and kept on wondering why that element wouldn’t receive the ID’s styling. :wink:

Would we be able to apply the principles behind linking to the same page with an ID to doing the same using classes instead?

For example:

Would this work?

you can try it? So far i know, that doesn’t work. Given a single class name can occur multiple times, the browser doesn’t know class name to jump to.