Create a media query error in the code

*Tell us what’s happening:
whenever i am clicking run its givinng me error though i am right
i hope this issue get solved

Your code so far


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

/* Only change code below this line */
@media (max-height: 10px)
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 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/83.0.4103.116 Safari/537.36 Edg/83.0.478.58.

Challenge: Create a Media Query

Link to the challenge:

Hey there @arsheencoder78618888

There are a couple things off.
The lesson wants you to create a media query that checks for a max-height of 800px. However your code is checking for 10px.


The other thing is that you CSS is not contained as part of the media query. The code that is supposed to be run if the media query is correct must be contained in curly brakcets:

@media (//Check for condition here) {
  //if true run this code
}

hello yes i corrected my code but still i am not passing it
MY CODE:
@media (max-height: 800px)
p {
font-size: 10px;
}
PLEASE TELL ME HOW TO PASS THIS TEST

I HOPE U ANSWER ME THANK YOU

Wrap your CSS rule for the paragraph within a pair of curly braces {}.

THANKS! it worked :smiley:

In the future, please create your own topic when you have specific questions about your own challenge code. Only respond to another thread when you want to provide help to the original poster of the other thread or have follow up questions concerning other replies given to the original poster.

The easiest way to create a topic for help with your own solution is to click the Ask for Help button located on each challenge. This will automatically import your code in a readable format and pull in the challenge url while still allowing you to ask any question about the challenge or your code.

Thank you.

1 Like