Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial

CSS CSS Basics Basic Selectors ID and Class Selectors

Angelica Islas
Angelica Islas
4,082 Points

Not sure how to solve this one

index.html
<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Developer Diane: Resume</title>
  <link rel="stylesheet" href="page.css">
  <link rel="stylesheet" href="style.css">
</head>
<body>
  <main>
    <header>
      <div>
        <h1>Developer Diane: Resume</h1>
        <address>
          <p>website: developerdiane.com</p>
          <p>email: diane@developerdiane.com</p>
        </address>
        <img src="developer-diane.jpg" alt="Developer Diane coding on her laptop.">
      </div>
    </header>          
    <section>
      <h2>Experience</h2>
      <ul>
        <li>
          <h3>Super Web Design Shop</h3>
          <p>Junior Developer</p>
          <p class="date special">February 2020-present</p>
        </li>
        <li>
          <h3>Pretty Good Websites, Inc.</h3>
          <p>Web Development Intern</p>
          <p>July 2019-January 2020</p>
        </li>
      </ul>
    </section>
    <footer>Ā©2020 Developer Diane.</footer>
  </main>
</body>
</html>
style.css
/* Complete the challenge by writing CSS below */
<header class="main-header"></header class>
Shane Oliver
Shane Oliver
19,977 Points
<header class="main-header"></header>

3 Answers

Hi Angelica,

I see two little issues in the code you posted:

One is that you actually wrote the html code in the css file (style.css) - that cannot work... ;-) So you want to put the html code in the index.html file.

The other issue is with that html you wrote: As Shane Oliver posted the correct html is:

<header class="main-header"></header>

In your code you wrote the "class" keyword twice (at the beginning and at the end): <header class="main-header"></header class> <-- This will produce an error.

Makes sense?

So you just have to delete the html from the css file and put the correct code above in the html.

Let us know if you have any more issues with the code challenge - happy to help.

Blessings from Berlin and happy java-scripting, Nils

PS: If my answer helped you or solved your issues, please upvote my answer and/or mark it as "Best answer" (so people browsing the community forum know your issue is solved)

Angelica Islas
Angelica Islas
4,082 Points

Hi, Nils. Where specifically do I place < header class="main-header"> </header class> ?

Hi Angelica,

the html <header> tag already exists in the index.html file.

It's on line 12 when you have the actual challenge open.

Blessings from Berlin and happy coding, Nils

PS: If my answer helped you or solved your issues, please upvote my answer and/or mark it as "Best answer" (so people browsing the community forum know your issue is solved)

Angelica Islas
Angelica Islas
4,082 Points

Shane Oliver I tried to do as you suggested and I got this message: Bummer: Make sure you're defining a class attribute inside the <header> tag, and setting the value to 'main-header'.