Learn CSS Flexbox by Building a Photo Gallery - Step 20 - SN_r9uusGO0aHeknFEnkF

Tell us what’s happening:
Describe your issue in detail here.

I’m having troubles with media queries. Can somebody help?

Thanks.

  **Your code so far**
/* file: index.html */
<!DOCTYPE html>
<html>
<head>
  <meta charset="utf-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Photo Gallery</title>
  <link rel="stylesheet" href="./styles.css">
</head>
<body>
  <div class="header">
    <h1>CSS FLEXBOX PHOTO GALLERY</h1>
  </div>
  <div id="gallery">
    <img src="https://cdn.freecodecamp.org/curriculum/css-photo-gallery/1.jpg"/>
    <img src="https://cdn.freecodecamp.org/curriculum/css-photo-gallery/2.jpg"/>
    <img src="https://cdn.freecodecamp.org/curriculum/css-photo-gallery/3.jpg"/>
    <img src="https://cdn.freecodecamp.org/curriculum/css-photo-gallery/4.jpg"/>
    <img src="https://cdn.freecodecamp.org/curriculum/css-photo-gallery/5.jpg"/>
    <img src="https://cdn.freecodecamp.org/curriculum/css-photo-gallery/6.jpg"/>
    <img src="https://cdn.freecodecamp.org/curriculum/css-photo-gallery/7.jpg"/>
    <img src="https://cdn.freecodecamp.org/curriculum/css-photo-gallery/8.jpg"/>
    <img src="https://cdn.freecodecamp.org/curriculum/css-photo-gallery/9.jpg"/>
    <img src="https://cdn.freecodecamp.org/curriculum/css-photo-gallery/10.jpg"/>
  </div>
</body>
</html>
/* file: styles.css */
* {
box-sizing: border-box;
}

body {
margin: 0;
font-family: Arial;
background: #EBE7E7;
}

.header {
text-align: center;
padding: 32px;
background: #E0DDDD;
}

#gallery {
display: flex;
flex-direction: row;
flex-wrap: wrap;
justify-content: center;
align-items: center;
padding: 0 4px;
}

#gallery img {
width: 25%;
height: 300px;
object-fit: cover;
margin-top: 8px;
padding: 0 4px;
border-radius: 10px;
}

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

User Agent is: Mozilla/5.0 (X11; CrOS x86_64 14816.82.0) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/103.0.0.0 Safari/537.36

Challenge: Learn CSS Flexbox by Building a Photo Gallery - Step 20

Link to the challenge:

You are close. You are missing a { and } as part of the media query selector.

I tried in between @media {and} #gallery img {}

Are you saying I need brackets, or a AND?

You are only missing the brackets.

I’m not finding where to put the brackets. Any clues?

What have you tried so far? The step instructions do not show you an example of a media query, but I will below:

@media (min-width: 250px) {
  p {
    color: #FF0000;
  }
}

Got it. Thanks. Strange one.

There are some users working on removing this step from the project and teaching media queries somewhere else but they are still working on it.

Awh, thanks. I figured it was something to learn, bummer we’re not going to get a lesson.

You will get it in another project and you will definitely use them multiple times in other projects to get practice