JavaScript CSS Selectors Quickstart CSS Selector Basics Basic Selectors Challenge

I am stuck. What am I doing wrong? I thought I set the ID selector and made the proper link in the CSS file.

I am trying to set up an ID selector in the HTML file first. Then I tried to reference it in the CSS file. From what I can see, I am following the prompt. Can someone show me what I am missing? Thanks. Have a nice day.

style.css
/* Complete the challenge by writing CSS below */

h1 {
   font-size: 62px;
}

#wilderness-landscape {
   margin-bottom: 20px;
}
index.html
<!DOCTYPE html>
<html>
  <head>
    <title>Basic Selectors Challenge</title>
    <link rel="stylesheet" href="page.css">
    <link rel="stylesheet" href="style.css">
  </head>
  <body>
    <header>
      <h1>Lake Tahoe, California</h1>
      <img id="wilderness-landscape" src="mtn-landscape.jpg" alt="foggy mountains">
    </header>
    <div>
      <h2>Journey Through the Sierra Nevada Mountains</h2>
      <p>Lake Tahoe is one of the most breathtaking attractions located in California. It's home to a number of ski resorts, summer outdoor recreation, and tourist attractions. Snow and skiing are a significant part of the area's reputation.</p>
    </div>
    <footer>
      All rights reserved to the state of California.
    </footer>
  </body>
</html>

1 Answer

Jason Anders
MOD
Jason Anders
Treehouse Moderator 145,300 Points

Hi Megan Zanders

Syntactically there is nothing wrong, but I'm a little confused by your question. There are 5 tasks in this challenge, but none of them ask for an id of wilderness-landscape to be added, nor do any ask to style that particular id. So, I'm not sure why you are adding that. ?

Looking at the CSS you have, it looks like you may be on the second task, which simply asks you to style the <img> element with a bottom margin of 20px.

So, delete the id you added in the HTML that wasn't instructed and just add CSS to the specification of the instructions. Keep in mind that the instructions for tasks are very particular and need to be followed exactly. If you add, delete, modify anything not asked for, the code checker will throw you a Bummer.

Keep Coding! :) :dizzy: