Cant Pass Challenge

Tell us what’s happening:
Need help, I have even copied the hint but still unable to pass the challenge.

  **Your code so far**

<style>
p {
  font-size: 20px;
}

/* Only change code below this line */
@media (max-height: 800px)
p {
  font-size: 10px;
}

/* Only change code above this line */
</style>

<p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Vivamus quis tempus massa. Aenean erat nisl, gravida vel vestibulum cursus, interdum sit amet lectus. Sed sit amet quam nibh. Suspendisse quis tincidunt nulla. In hac habitasse platea dictumst. Ut sit amet pretium nisl. Vivamus vel mi sem. Aenean sit amet consectetur sem. Suspendisse pretium, purus et gravida consequat, nunc ligula ultricies diam, at aliquet velit libero a dui.</p>
  **Your browser information:**

User Agent is: Mozilla/5.0 (Windows NT 6.1; Win64; x64; rv:90.0) Gecko/20100101 Firefox/90.0

Challenge: Create a Media Query

Link to the challenge:

1 Like

Hey there- this looks great so far!

Don’t forget the extra set of brackets at the end of the media line and at the end of the entire bit of code.

Your code should look like this.

   @media (max-height: 800px) {
  p {
    font-size: 10px;
  }
}


Tried adding the extra brackets but the results is still the same, is it possible that the challenge may be bugged somehow?

It would be better if you actually pasted your code in here (wrap it in triple backticks) so we can test it for ourselves.

When you enter a code block into a forum post, please precede it with a separate line of three backticks and follow it with a separate line of three backticks to make it easier to read.

You can also use the “preformatted text” tool in the editor (</>) to add backticks around text.

See this post to find the backtick on your keyboard.
Note: Backticks (`) are not single quotes (’).

1 Like
<style>
  p {
    font-size: 20px;
  }

  /* Only change code below this line */
@media (max-height: 800px) {
  p {
    font-size: 10px;
  }
}
  /* Only change code above this line */
</style>

<p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Vivamus quis tempus massa. Aenean erat nisl, gravida vel vestibulum cursus, interdum sit amet lectus. Sed sit amet quam nibh. Suspendisse quis tincidunt nulla. In hac habitasse platea dictumst. Ut sit amet pretium nisl. Vivamus vel mi sem. Aenean sit amet consectetur sem. Suspendisse pretium, purus et gravida consequat, nunc ligula ultricies diam, at aliquet velit libero a dui.</p>

Sorry for not adding the code earlier, for i am still very new, like i said, i have tried adding the extra brackets but it seems i havent completed any of the task required to finish this challenge.

1 Like

Thanks for the tip, appreciate it. :grinning:

1 Like

No worries, we were all beginners here at one time.

I pasted your code into the challenge and it passed for me. Are you getting any errors in the console window below the editor?

1 Like

The code you have shared works on my end. Please ensure that you have disabled any extensions that interface with the freeCodeCamp website (such as Dark Mode and Ad Blocker), and set your browser zoom level to 100%. Both of these factors can cause tests to fail erroneously.

3 Likes

Thanks a lot, problem solved. As suggested, Dark Mode might have caused the error on my end.

1 Like
@media (max-height: 800px) { 

   p {

    font-size: 10px;

  }

 }

Hi @lighty !

Welcome to the forum!

This topic has already been solved if you need help with a challenge please create a new topic .

Thanks!

I’ve edited your post for readability. When you enter a code block into a forum post, please precede it with a separate line of three backticks and follow it with a separate line of three backticks to make it easier to read.

You can also use the “preformatted text” tool in the editor (</>) to add backticks around text.

See this post to find the backtick on your keyboard.
Note: Backticks (`) are not single quotes (’).

This topic was automatically closed 182 days after the last reply. New replies are no longer allowed.