This exercise nests anchors within `<li>` elements. Wouldn’t it make more sense to make the entire `<li>` a clickable anchor by nesting the `<li>` in anchor tags instead?

Looks like you missed lines 14 and 15.

1 Like

Awesome, thank you @mtf I didn’t realize that it was asking me to do all three lines. For some reason I thought it only wanted me to do one.

1 Like

Apply to each list item and will be work…

Bonjour, je voudrai savoir si quelqu’un pourrais m’aider svp. Mon problème et que je n’arrive pas à finir un exercice.

image

1 Like

Bonjour! Je ne sais pas quel est le problème, vous avez le même code que la solution. Il se peut que vous n’ayez pas capitalisé le I dans l’introduction. À part ça, je n’en ai aucune idée. De plus, je suis désolé si mon Français est mauvaise, j’utilise un traducteur.

Il se peut aussi que vous ayez « Médias » au lieu de « Media ». Même si c’est dans Français, donc ce n’est probablement pas ça.

1 Like

Can all elements be a target id, like in the sheet the div was the target, can different head levels or a ul/ol etc also be targeted ?

We can target any element with id but should not go over board. Usually only a handful of elements require special treatment such as CSS or script, and only the headings or parent containers (sections) need to be identified as linkable page fragments.

1 Like

thanks for the answer!

1 Like

I’ve been thinking the text after the '#" is actually the value of id attribute I wish to link it to. Is the linking to same page is somehow internally related to id attributes?

I’ve been thinking the text after the '#" is actually the value of id attribute I wish to link it to. Is the linking to same page is somehow internally related to id attributes?

A hash in the URL indicates a page fragment with a global ID that can be hooked by the browser. Clicking a link to a fragment will cause the page to scroll the identified element to the top of the window.

Im having the same issue with my introduction. Can someone help?

Hey, @giga8631138003 welcome to the forums

Can you copy and paste your code here so we can help you. It’s harder when it’s in a screenshot and we can not see all of it currently.

For some reason it wont let me post my copied code to you

Then can you put it in a GH repository or a gist to share your code and give us the link to that?

(post deleted by author)

I figured it out, thanks!

1 Like

Hi! I tried both options:

I created a link by nesting the anchor element as the primary anchor & then creating the list item
I also followed the CodeAcademy Prompt of adding the anchoring link after creating the list item

Both work! However…
Option 1 creates a link for the ENTIRE line. So if you click anywhere on that line then it will take you to the specified location within the document. Also, it “links” the bullet symbol as well.
*thinking from a user perspective, this option would be frustrating as the user could click anywhere on that line and the page would continuously jump to a different part of the page.

Option 2. is visually more appealing and cleaner (which is why they want us to use this method) All of the bullet symbols are black & only the “title” of the list item is linked; not the entire line.

See attached screenshot! Hope this helps!!
Screenshot 2022-04-15 20.50.48

2 Likes

How did you figure it out? I have the same issue.

Thanks :slight_smile: this is really helpful.

1 Like