HTML Basic Lesson 15/17


#1

I put this code, but it does not work.

<ul>
  <li><a 
  href="#Introduction">Introduction</a></li>
  <li><a 
  href="#Habitat">Habitat</a></li>
  <li><a 
  href="#Media">Media</a></li>
</ul>

Any help


#2

In order to help you, we’re going to need two things:

  • Any and all error messages you receive
  • Your formated code (Alternatively, just post a screenshot of your code)

#3

https://www.codecademy.com/courses/learn-html-elements/lessons/common-html-elements/exercises/linking-same-page-html?action=lesson_resume&course_redirect=learn-html

Error message:
Did you open the tag before introduction and close it after introduction?

Any help.


#4

the href attribute can’t be be on a separate line, the whole opening tag (including href) should be on a single line, for example:

<a href="#">
  Your text</a>

#5

Even better, would be to just have it all on one line, like so:

<a href="#">Your text</a>

#6

agree, or something like:

<li>
    <a href="#">Your text</a>
</li>

I was just showing where the limits are :wink:


#7

I tried all 3 ways but it still does not work.

  <ul>
    <li>
        <a href="#Introduction">
          Introduction</a>
    </li>
    <li>
        <a href="#Habitat">
          Habitat</a>
    </li>
    <li>
        <a href="#Media">
          Media</a>
    </li>
  </ul>
  <ul>
    <li><a href="#Introduction">Introduction</a></li>
    <li><a href="#Habitat">Habitat</a></li>
    <li><a href="#Media">Media</a></li>
  </ul>
<ul>
    <li>
        <a href="#Introduction">Introduction</a>
    </li>
    <li>
        <a href="#Habitat">Habitat</a>
    </li>
    <li>
        <a href="#Media">Media</a>
    </li>
</ul>

#8

Don’t use capitals on ID’s. introduction, habitat, media.


#9

That was a problem:

It works now.
Many thanks.


#10

I had typed my href in capital letter too and ran into the same problem. First time I’ve heard that HTML is case sensitive. Are there any other tags in HTML where caps make a difference?


#11

HTML5 is XML conforming so the answer is, no uppercase tags. To use uppercase tags, switch the doctype to HTML 4.1 (then again, why would do this?)


#12

Thanks for the tip! :slight_smile: They should mention that in the HTML5 training, I
had a hard time figuring out what I had done wrong. Thanks again!


#13

A post was split to a new topic: Html basic lesson 15/17


#14

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.