question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

[beta] Create a Media Query - Instructions and test don't match

See original GitHub issue

Challenge create-a-media-query has an issue. User Agent is: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_11_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/55.0.2883.95 Safari/537.36. Please describe how to reproduce this issue, and include links to screenshots if possible.



<style>
  @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>

In the “Create a Media Query” challenge, the instructions and the test don’t match. The instructions say:

Add a media query, so that the p tag has a font-size of 10px when the device’s height is smaller than 800px.

Smaller than 800px means 799 or less, so the correct media query should be “max-width: 799px”. The test actually passes with “max-width: 800px”, which translates into English as 800px or smaller.

Basically, the instructions call for width < 800, but the test checks for width <= 800. Either one is fine, but they need to match each other.

Issue Analytics

  • State:closed
  • Created 7 years ago
  • Comments:7 (3 by maintainers)

github_iconTop GitHub Comments

7reactions
gabribasscommented, Jul 18, 2018

I figure out why it wasn’t working for me, hope it can be of help to someone else too. I wasn’t including the “p tag” in the curly brackets under the media query.

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

/* Add media query below */ @media (max-height: 800px) {p {font-size: 10px;}}

</style>`

0reactions
wuxmediacommented, Aug 8, 2019

only because this is the first result for googling this error - check the forum post - https://www.freecodecamp.org/forum/t/create-a-media-query/185828 basically you need to make sure in Chrome’s settings that the font sizes are 10px minimum (otherwise this just doesn’t pass ever)

Read more comments on GitHub >

github_iconTop Results From Across the Web

Using media queries - CSS: Cascading Style Sheets | MDN
A media query computes to true when the media type (if specified) matches the device on which a document is being displayed and...
Read more >
media query breakout does not match - Stack Overflow
As mentioned in the comments, the issue was caused due to the page zoom level not set to 100%.
Read more >
Media Queries Level 4 - W3C
A media query is a method of testing certain aspects of the user agent or device that the document is being displayed in....
Read more >
How to use CSS Breakpoints & Media Query ... - BrowserStack
Adding a breakpoint here would prevent this from happening. The point of adding any breakpoint is to make content easy to read. This...
Read more >
A Complete Guide to CSS Media Queries
But just to be clear, this doesn't always prevent the stylesheets that don't match those media queries from downloading, it just assigns them...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found