Can't get past "Learn CSS Flexbox by Building Photo Gallery Step 20"

My CSS answer:

@media only screen and (max-width: 800px) {
  #gallery img {
    width: 50%;
  }
}

The result is correct → Get a 2 col layout on screen. But “Check Your Code” button says is incorrect. (see below).

Check your code answer:
":heavy_multiplication_x: Sorry, your code does not pass. Hang in there.

Hint Your new @media query should have a max-width of `800px."

1 Like

Try removing the only screen and part in your code. The solution would contain:

@media (max-width: 800px) {

1 Like

Thank you!!! Why did that work?

@media (max-width: 800px) {
  #gallery img {
    width: 50%;
  }
}

was correct for me, just tried it right now.

Yes! Sorry I only deleted “only” at first and still did not pass. But reread your suggestion and deleted both “screen” and “only”. That worked 2nd time.

You’re welcome, I’m glad I could help. You actually wrote correct code the first time, but the lesson required a different solution to pass. Also, if I helped, could you mark my answer as a solution? Thanks.

Done. Thank you again Eesa!

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