Difficulty with Create a Media Query

Difficulty with Create a Media Query
0

#1

Tell us what’s happening:
I am stucking with the following code, I think it’s the right one, I even copy paste the answer directly on the webpage,

@media(max-height:800px){
p {
font-size: 10px;
}
}
but it wont through, still says: Your p element should have the font-size of 10px when the device height is less than or equal to 800px. could anyone help me with that? thanks in advance!

Your code so far


<style>
  p {
    font-size: 20px;
  }
  
  /* Add media query below */
    @media(max-height:800px){ 
        p {
        font-size: 10px;
          }
    }
</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/68.0.3440.106 Safari/537.36.

Link to the challenge:
https://learn.freecodecamp.org/responsive-web-design/responsive-web-design-principles/create-a-media-query


#2

Looks like it should work. I just did it.

<style>
  p {
    font-size: 20px;
  }
  
  /* Add media query below */

  @media (max-height: 800px) {
     p {
       font-size: 10px;
     }
  }
  
</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>

#3

When I copy and paste your code into the challenge it passes all of the tests and completes the challenge.


#4

Great! On to the next challenge.


#5

That’s the part confuses me…:expressionless:


#6

I think these things just happen. I’ve copied and pasted stuff before and it would work on one screen but not another. Yes, it’s maddening, but it happens.


#8

Thanks mate, but if I want to get the certificate, do I have to earn the point for clicking Run the Test? or I can just ignore it?


#9

I don’t run the program here, but I think it has to pass all the requirements to get the cert.


#10

thanks, i tried with firefox, it works.:grinning::grinning:


#11

Great! I also think that you’re only required to complete the projects to get the certificate. The challenges are optional and meant to help you in the projects.


#12

Thanks,I just started it, FCC is awesome :+1: