Build a Cat Blog Page - Step 9

Tell us what’s happening:

Hello everyone I am having an issue with the anchor elements that I have put in place here. I am not sure what the problem is if anyone has some helpful hints, it would be greatly appreciated.

Your code so far

<!DOCTYPE html>
<html lang="en">
  <head>
    <title>Mr. Whiskers' Blog</title>
    <meta charset="UTF-8" />
  </head>
  <body>
    <header>
      <h1>Welcome to Mr. Whiskers' Blog Page!</h1>
      <figure>
        <img
          src="https://cdn.freecodecamp.org/curriculum/css-photo-gallery/1.jpg"
          alt="a cat peacefully sleeping"
        />
        <figcaption>Mr. Whiskers Sleeping</figcaption>
      </figure>

<!-- User Editable Region -->

      <nav>
        <ul>
          <li>About<a href="#about"></li>
          <li>Posts<a href="#posts"></li>
          <li>Contact<a href="#contact"></li>
        </ul>
      </nav>

<!-- User Editable Region -->

    </header>
  </body>
</html>

Your browser information:

User Agent is: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/137.0.0.0 Safari/537.36

Challenge Information:

Build a Cat Blog Page - Step 9

hi and welcome to the forum.

I have a hint for you. There are two types of elements in HTML. Those that are self-closing and those that are not.
The ones that are not usually require 2 tags. An opening and a closing tag.

So I would ask you: do you know if anchor elements are self-closing or not?

Hi. You have a few issues:

  1. You have no closing tags for your a elements.
  2. Your a elements don’t wrap the text.

Thank you for your help I initially thought that the anchor element was self closing .

1 Like

one way to tell is to ask yourself what is the purpose of the tag.
In the case of the anchor, its purpose is to tell the browser which words are to be clickable by a user (so that an href is visited). If we don’t tell the browser exactly which words to include, then how will it decide how to act?

eg.
<a href="www.google.com">Is this a link?

eg.
<a href="www.goolge.com">Which part is the link?

No closing tag will make it impossible to know which words were clickable in those examples.