# Error on Tribute page

**URL:** <https://forum.freecodecamp.org/t/error-on-tribute-page/432471>\
**Category:** I Built This\
**Created:** [November 27, 2020, 5:55am UTC](https://forum.freecodecamp.org/t/error-on-tribute-page/432471 "2020-11-27T05:55:13Z")\
**Posts on this page:** 14\
**Page:** 1

<div class="post-metadata">

**Author:** ![agrawalparul2](https://sea3.discourse-cdn.com/freecodecamp/user_avatar/forum.freecodecamp.org/agrawalparul2/32/136006_2.png) [@agrawalparul2](https://forum.freecodecamp.org/u/agrawalparul2)\
**Post date:** [November 27, 2020, 5:55am UTC](https://forum.freecodecamp.org/t/error-on-tribute-page/432471/1 "2020-11-27T05:55:13Z")

</div>

Hello,

I just finished my tribute page project. When I run it it says I have done 9/10 tests. Its highlighting issue with userstory1. Can anybody help me to understand this issue?

Below is the link to my tribute page:-

[https://codepen.io/agrawalparul2/pen/YzGzrWY](https://codepen.io/agrawalparul2/pen/YzGzrWY)

I get following issue with User story 1:-

User Story #1. My tribute page should have an element with corresponding id=“main”, which contains all other elements.  
expected null to not equal null  
AssertionError: expected null to not equal null  
at Proxy.c ([https://cdn.freecodecamp.org/testable-projects-fcc/v1/bundle.js:549:1889](https://cdn.freecodecamp.org/testable-projects-fcc/v1/bundle.js:549:1889))  
at Proxy.l ([https://cdn.freecodecamp.org/testable-projects-fcc/v1/bundle.js:431:130](https://cdn.freecodecamp.org/testable-projects-fcc/v1/bundle.js:431:130))  
at Function.n.isNotNull ([https://cdn.freecodecamp.org/testable-projects-fcc/v1/bundle.js:574:1549](https://cdn.freecodecamp.org/testable-projects-fcc/v1/bundle.js:574:1549))  
at a. ([https://cdn.freecodecamp.org/testable-projects-fcc/v1/bundle.js:657:118298](https://cdn.freecodecamp.org/testable-projects-fcc/v1/bundle.js:657:118298))  
at [https://cdn.freecodecamp.org/testable-projects-fcc/v1/bundle.js:598:38668](https://cdn.freecodecamp.org/testable-projects-fcc/v1/bundle.js:598:38668)  
at i.g.run ([https://cdn.freecodecamp.org/testable-projects-fcc/v1/bundle.js:598:38963](https://cdn.freecodecamp.org/testable-projects-fcc/v1/bundle.js:598:38963))  
at N.runTest ([https://cdn.freecodecamp.org/testable-projects-fcc/v1/bundle.js:598:45686](https://cdn.freecodecamp.org/testable-projects-fcc/v1/bundle.js:598:45686))  
at [https://cdn.freecodecamp.org/testable-projects-fcc/v1/bundle.js:598:46651](https://cdn.freecodecamp.org/testable-projects-fcc/v1/bundle.js:598:46651)  
at o ([https://cdn.freecodecamp.org/testable-projects-fcc/v1/bundle.js:598:45075](https://cdn.freecodecamp.org/testable-projects-fcc/v1/bundle.js:598:45075))  
at [https://cdn.freecodecamp.org/testable-projects-fcc/v1/bundle.js:598:45145](https://cdn.freecodecamp.org/testable-projects-fcc/v1/bundle.js:598:45145)

---

<div class="post-metadata">

**Author:** ![sitek94](https://sea3.discourse-cdn.com/freecodecamp/user_avatar/forum.freecodecamp.org/sitek94/32/336491_2.png) [@sitek94](https://forum.freecodecamp.org/u/sitek94)\
**Post date:** [November 27, 2020, 7:04am UTC](https://forum.freecodecamp.org/t/error-on-tribute-page/432471/2 "2020-11-27T07:04:13Z")

</div>

First of all, when using codepen you don’t have to use `html` and `head` tags. Codepen provides that boilerplate for you behind the scenes. Anything you write in the HTML section is actually what you would put in between the body tags.

If you want to include something in `head` of the document you can do so in the codepen settings:

![codepen-settings](https://global.discourse-cdn.com/freecodecamp/original/3X/0/f/0ff71939e3ab5c9c3a10f09984eb5ad458cd4f14.png)

Now back to your issue. This is the important part of your error message:

> My tribute page should have an element with corresponding id=“main”, which contains all other elements.

Did you have an element with id=“main” in your code?

---

<div class="post-metadata">

**Author:** ![Annestezia](https://sea3.discourse-cdn.com/freecodecamp/user_avatar/forum.freecodecamp.org/annestezia/32/74275_2.png) [@Annestezia](https://forum.freecodecamp.org/u/Annestezia)\
**Post date:** [November 27, 2020, 7:08am UTC](https://forum.freecodecamp.org/t/error-on-tribute-page/432471/3 "2020-11-27T07:08:45Z")

</div>

`<head>` tag is pretty specific as to [what should be in it](https://www.w3schools.com/html/html_head.asp), element with id #main was supposed to be main content of your page, you can use e.g. `<div>` or `<main>`

---

<div class="post-metadata">

**Author:** ![jwilkins.oboe](https://sea3.discourse-cdn.com/freecodecamp/user_avatar/forum.freecodecamp.org/jwilkins.oboe/32/179497_2.png) [@jwilkins.oboe](https://forum.freecodecamp.org/u/jwilkins.oboe)\
**Post date:** [November 27, 2020, 7:18am UTC](https://forum.freecodecamp.org/t/error-on-tribute-page/432471/4 "2020-11-27T07:18:09Z")

</div>

Hey @agrawalparul2!

The other posters already provided you with the answer you were looking for but I do want to mention two things that should be fixed before submitting.

1. Please do not use br tags. br tags are used when division of lines is significant like in a poem or address. Please use css for space between elements.

2. The center tag is no longer used in HTML 5. Please use CSS instead.

Happy coding!

---

<div class="post-metadata">

**Author:** ![agrawalparul2](https://sea3.discourse-cdn.com/freecodecamp/user_avatar/forum.freecodecamp.org/agrawalparul2/32/136006_2.png) [@agrawalparul2](https://forum.freecodecamp.org/u/agrawalparul2)\
**Post date:** [November 27, 2020, 9:24am UTC](https://forum.freecodecamp.org/t/error-on-tribute-page/432471/5 "2020-11-27T09:24:26Z")

</div>

Thanks so much for feedback.

---

<div class="post-metadata">

**Author:** ![agrawalparul2](https://sea3.discourse-cdn.com/freecodecamp/user_avatar/forum.freecodecamp.org/agrawalparul2/32/136006_2.png) [@agrawalparul2](https://forum.freecodecamp.org/u/agrawalparul2)\
**Post date:** [November 27, 2020, 10:10am UTC](https://forum.freecodecamp.org/t/error-on-tribute-page/432471/7 "2020-11-27T10:10:04Z")

</div>

Thanks for help.

I could catch my mistake. I had put id main for head, which was incorrect way.  
I changed and created div (which had all elements) and assigned id=“main”.

---

<div class="post-metadata">

**Author:** ![Roma](https://sea3.discourse-cdn.com/freecodecamp/user_avatar/forum.freecodecamp.org/roma/32/112899_2.png) [@Roma](https://forum.freecodecamp.org/u/Roma)\
**Post date:** [November 27, 2020, 3:45pm UTC](https://forum.freecodecamp.org/t/error-on-tribute-page/432471/8 "2020-11-27T15:45:01Z")

</div>

@agrawalparul2 good job on getting the user stories to pass but there are some serious issues with your page that you should revisit.

- As was previously mentioned, codepen provides the boilerplate for you. It only expects the code you’d put within the `body` element in HTML. (No need to include the `body` tags). For anything you want to add to the `<head>` element click on the ‘Settings’ button, then HTML and add it into the ‘Stuff for \<head\>’ box.
  - You have elements out of order and incorrectly used. You can review this for an understanding of the [HTML boilerplate tags](https://medium.com/better-programming/understanding-the-tags-in-html-boilerplate-38d1ae2805f7).

- Also, you should run your HTML code through the [W3C validator](https://validator.w3.org/#validate_by_input).
  - There are HTML coding errors you should be aware of and address.

- And as mentioned, do not use the `<br>` element to force line breaks or spacing. That’s what CSS is for.
  - There are places in your code where you’re using it in a way that is against the published standards.

> **[: The Line Break element](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/br)**
>
> The HTML br element produces a line break in text (carriage-return). It is useful for writing a poem or an address, where the division of lines is significant.

> **[DevDocs](https://devdocs.io/html/element/br)**

---

<div class="post-metadata">

**Author:** ![agrawalparul2](https://sea3.discourse-cdn.com/freecodecamp/user_avatar/forum.freecodecamp.org/agrawalparul2/32/136006_2.png) [@agrawalparul2](https://forum.freecodecamp.org/u/agrawalparul2)\
**Post date:** [November 27, 2020, 7:37pm UTC](https://forum.freecodecamp.org/t/error-on-tribute-page/432471/10 "2020-11-27T19:37:37Z")

</div>

That was great information. It gave me lot of clarity on what goes where. When I ran code on validator I had loads of issues, I fixed them all except DOCTYPE, language and missing head tags (as we do not enter these in codepen).

I have also removed all the `<br>` tags and used CSS instead.

Here is the link to my new tribute page.

[https://codepen.io/agrawalparul2/pen/YzGzrWY?editors=1100](https://codepen.io/agrawalparul2/pen/YzGzrWY?editors=1100)

Let me know things I can improve to make code look better.

---

<div class="post-metadata">

**Author:** ![jwilkins.oboe](https://sea3.discourse-cdn.com/freecodecamp/user_avatar/forum.freecodecamp.org/jwilkins.oboe/32/179497_2.png) [@jwilkins.oboe](https://forum.freecodecamp.org/u/jwilkins.oboe)\
**Post date:** [November 27, 2020, 8:06pm UTC](https://forum.freecodecamp.org/t/error-on-tribute-page/432471/11 "2020-11-27T20:06:58Z")

</div>

I think it looks a lot better. Good job making those changes.

My thoughts:

- I would personally use the strong tag over the b tag here. The strong tag is used for strong emphasis whereas the b tag doesn’t really hold any importance.

```auto
   <h1 id="title"> <b>MAHATMA GANDHI</b> </h1>

```

- I think the img alt tag should have text in it. It is important for those with assistive devices.

---

<div class="post-metadata">

**Author:** ![agrawalparul2](https://sea3.discourse-cdn.com/freecodecamp/user_avatar/forum.freecodecamp.org/agrawalparul2/32/136006_2.png) [@agrawalparul2](https://forum.freecodecamp.org/u/agrawalparul2)\
**Post date:** [November 27, 2020, 8:11pm UTC](https://forum.freecodecamp.org/t/error-on-tribute-page/432471/12 "2020-11-27T20:11:32Z")

</div>

Sure. Many thanks FCC and the forum is really helpful to continue learning in organized way.

---

<div class="post-metadata">

**Author:** ![Roma](https://sea3.discourse-cdn.com/freecodecamp/user_avatar/forum.freecodecamp.org/roma/32/112899_2.png) [@Roma](https://forum.freecodecamp.org/u/Roma)\
**Post date:** [November 27, 2020, 8:47pm UTC](https://forum.freecodecamp.org/t/error-on-tribute-page/432471/13 "2020-11-27T20:47:44Z")

</div>

Your page looks good @agrawalparul2. Nice job cleaning things up.

Yes, when running the W3C validator you’re correct in ignoring the first warning and first two errors.

There’s a little typo in your CSS (line 27).

- Codepen provides validators for HTML, CSS and JS. Click on the down arrow in the upper right of each section and then click on the respective ‘Analyze’ link.
  - The one for CSS is good. Use it and address the issue(s).
  - (The one for HTML misses things which is why I recommend W3C)

---

<div class="post-metadata">

**Author:** ![agrawalparul2](https://sea3.discourse-cdn.com/freecodecamp/user_avatar/forum.freecodecamp.org/agrawalparul2/32/136006_2.png) [@agrawalparul2](https://forum.freecodecamp.org/u/agrawalparul2)\
**Post date:** [November 28, 2020, 6:13am UTC](https://forum.freecodecamp.org/t/error-on-tribute-page/432471/14 "2020-11-28T06:13:38Z")

</div>

yes I missed “-” for background-color attribute. Analyze CSS and Analyze html another great feature to clean up the code.

---

<div class="post-metadata">

**Author:** ![thonyarrieche77](https://sea3.discourse-cdn.com/freecodecamp/user_avatar/forum.freecodecamp.org/thonyarrieche77/32/186872_2.png) [@thonyarrieche77](https://forum.freecodecamp.org/u/thonyarrieche77)\
**Post date:** [November 29, 2020, 10:47pm UTC](https://forum.freecodecamp.org/t/error-on-tribute-page/432471/15 "2020-11-29T22:47:00Z")

</div>

Hi there! Your page looks pretty good.

I think you could save some HTML lines by using a new class. That way you could avoid using **tags that much.**

 

Make sure #family is styled correctly in order to display the information as you expect. Here’s an example how the code may look:

```auto
<html>
  <ul>
        <li><span class="bold-text">October 2, 1869:</span> Birth of Mohandas Karamchand Gandhi<li>
  </ul>
</html>

<style>
.bold-text {
 font-weight: bolder;

}
</style>

```

I’d suggest you review the class and id usage. And how nesting them can make style and CSS sweeter!

Thanks for sharing!

---

<div class="post-metadata">

**Author:** ![ILM](https://sea3.discourse-cdn.com/freecodecamp/user_avatar/forum.freecodecamp.org/ilm/32/363239_2.png) [@ILM](https://forum.freecodecamp.org/u/ILM)\
**Post date:** [June 1, 2021, 1:08pm UTC](https://forum.freecodecamp.org/t/error-on-tribute-page/432471/16 "2021-06-01T13:08:00Z")

</div>

Closed on June 1, 2021, 1:08pm UTC


