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.

Responsive Web Design Principles: Create a Media Query - Test won't pass

See original GitHub issue

Challenge Name

Responsive Web Design Principles: Create a Media Query https://beta.freecodecamp.org/en/challenges/responsive-web-design-principles/create-a-media-query

Issue Description

Even though the correct answer was submitted it shows the error message, the output of the code is changed properly in the preview panel but the instructions panel is still showing the error message as “Declare a @media query for devices with a height less than or equal to 800px”.

Browser Information

  • Browser Name, Version: Google Chrome, Version 65.0.3318.0 (Official Build) canary (64-bit)
  • Operating System: MacOS High Sierra
  • Mobile, Desktop, or Tablet: Desktop

Your Code


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

Screenshot

issue_screenshot

Issue Analytics

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

github_iconTop GitHub Comments

3reactions
ahmadabdolsahebcommented, Jan 24, 2018

@raisedadead @vkWeb @manikandanelangovan

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

the tests are fine but the description could be improved by adding height, width, max and min to the example so the user learns about the possibilities and have more context to solve the challenge.

If you are interested i could make a PR to change the example part of the description to the following:

Here’s an example of a media query that returns the content when the device’s width is less than or equal to 100px:

@media (max-width: 100px) { /* CSS Rules */ }

and the following media query returns the content when the device’s height is more than or equal to 350px:

@media (min-height: 350px) { /* CSS Rules */ }

Remember, the CSS inside the media query is applied only if the media type matches that of the device being used.

1reaction
ahmadabdolsahebcommented, Jan 26, 2018

@raisedadead @huyenltnguyen @vkWeb, it is my first PR after a while so not sure if it gives a notification to the moderators or not 😃 let’s 🚢 it

Read more comments on GitHub >

github_iconTop Results From Across the Web

Responsive Web Design Principles - Create a Media Query
In this responsive web design principle tutorial, we create a media query to demonstrate how we can have our application design react to...
Read more >
Responsive web design basics
Take a look at our complete course on Responsive Web Design—Learn Design ... Media queries enable us to create a responsive experience where ......
Read more >
Get stuck in "Create a Media Query" - HTML-CSS
My code can't passed the test, it tells me “Your p element should have the font-size of 10px when the device height is...
Read more >
Responsive Design Tutorial: Media Query Examples & More
Use media queries and pseudo-elements for design and give your mobile users a responsive mobile experience—in pure CSS.
Read more >
Responsive Web Design. Do I need media queries? - Medium
A big factor in my decision to work with React Native was the desire to create an application that looked good on a...
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