I'm unclear on the directions for the Tribute Page project

I'm unclear on the directions for the Tribute Page project
0

I’m trying to do my first project. The first test is to “have an element with a corresponding id="main" which contains all other elements.”

So I wrote the HTML:

<main id="main">
  </main>

I am not clear if the “corresponding” id means it’s contained within the HTML, corresponding to the element, or is it a CSS selector “corresponding” to the Main element?

Also, should we start the code with <!DOCTYPE html>?

And should we be wrapping the Main element in a Body element? Generally speaking, should we be following the user story indications exactly, or follow the instructions we learned in the HMTL curriculum?

In any case, my first test is failing. Any help would be appreciated!

Don’t worry about the “corresponding” wording. It should have “main” as the id and it should contain all the other elements.

If you’re using CodePen, you don’t need to worry about DOCTYPE or body, etc. It’s handled for you by CodePen.

1 Like

Ok thanks.

But this code still is failing:

<script src="https://cdn.freecodecamp.org/testable-projects-fcc/v1/bundle.js"></script>
  <main id="main">
  </main>

(I’m assuming I keep the “script” code at the beginning?)

Of course it’s failing. It doesn’t contain all the required elements.

Yes. Leave that script tag where it is.

1 Like

you should be passing one of the tests from user stories like that (you can click on the number of tests to see what you are passing and what not)

1 Like

Ok- so is my code merely incomplete, or incorrect? Because it states “As you fulfill each test case, you will see them go from red to green.” So am I missing a required element to add an id to the main element? Or is the expectation that I should attempt to complete all the user stories prior to running a test? (I would prefer to see that I’m doing it correctly as I go along)

I’m not. The only “test” I’m passing is the “#Technology Stack” (but I was “passing” that before I started).

maybe it doesn’t pass till you put some content in it
what’s written below the user story? there is a sort of explanation of why it is not passing

Well, it seems the title element needed another element. But I don’t understand why I’m putting an element with an id of “title” into the body of the HTML, when we were instructed to to put that in the head of the HTML?

A “title” in the head section is a special thing. This is just the title of your article.

1 Like

what’s written below the user story? there is a sort of explanation of why it is not passing

anyway, as you keep adding things, to help you we will need to see the pen

1 Like

Thank you both for the help. It seems to be passing now that I added text within main section… If I have more problems, then I’ll paste a link to the pen.