Responsive Web Design Projects - Build a Tribute Page - Robert P

Tell us what’s happening:

I do not understand what I am not doing right. I am about to pull my hair out. I was rocking and rolling through all of the courses, but now I am just lost. I have googled and searched and pondered and I can not find an answer.

If my main tag is to hold all of the other elements, then how do I have it referenced as an id? Please don’t give me the answer, tell me how I can figure this out, or where I will find the answer. Please and thank you.

Your code so far
CSS Code***

body {background-color: grey;}
h1{
  text-align: center;
  font-size: 100px;
  color: tan;
  border-bottom: 6px solid black;
  background-color: white;
  
}
h2{
  text-align: center;
  font-size: 55px;
  color: orange;
  margin: 0;
  padding: 1fr;
}
h3{
  text-align:center;
    font-size: 34px;
      color: lightgray;
}

HTML code


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

<title>Responsive Web Design Projects - Build a Tribute Page</title>
   
</head>
<body>
  <h1>Alfred Nobel</h1>
  <h2> The Man That Invited Dynamite</h2>
  <h3>He may have also created the Nobel Prize</h3>
<main>
  
</main>
  
</body>
  </html>

Your browser information:

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

Link to the challenge:
https://learn.freecodecamp.org/responsive-web-design/responsive-web-design-projects/build-a-tribute-page/

Here is an easy and short read on how to reference ID’s in CSS.

ID Selectors in CSS

I’ve edited your post for readability. When you enter a code block into the forum, precede it with a line of three backticks and follow it with a line of three backticks to make easier to read. See this post to find the backtick on your keyboard. The “preformatted text” tool in the editor (</>) will also add backticks around text.

markdown_Forums

1 Like

Ok, I have read that, and I am curious, if I use the tag, and then in the css editor declare it as an element, would that not affect everything in my section with the tag?

Or will it only affect the div I use that contains the “id=“main””?

This is a sentence.

Where Main is given a blue background?

User Story #1: My tribute page should have an element with a corresponding id=“main”, which contains all other elements.

From what I understand, an element is any tag. Is that right?

I just put this code into the editor for CSS

#main{
  background-color: blue;
}

I then put this in the HTML editor

<body>
  <h1>Alfred Nobel</h1>
  <h2> The Man That Invited Dynamite</h2>
  <h3>He may have also created the Nobel Prize</h3>
<main>
  <p id="main">This is a sentance</p>
</main>

I ran the test and it is still not saying I passed it so what am I doing wrong now?

I need the code visible as its an issue with the code…

I’ve edited your post for readability. When you enter a code block into the forum, precede it with a line of three backticks and follow it with a line of three backticks to make easier to read. See this post to find the backtick on your keyboard. The “preformatted text” tool in the editor (</>) will also add backticks around text.

markdown_Forums

I solved this. My body needed the main element id.

1 Like