Learn CSS Flexbox by Building a Photo Gallery - Step 12

Hi, can someone please give me some insight on what is wrong with my CSS code? The error says “You should have a body selector.” & I’ve tried a few different ways to get it to go through, but I can’t seem to move forward with this lesson. :frowning:

<!-- file: index.html -->
<!DOCTYPE html>
<html lang="en">
  <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>
    <header class="header">
      <h1>css flexbox photo gallery</h1>
    </header>
    <div class="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">
    </div>
  </body>
</html>
/* file: styles.css */
* {
  box-sizing: border-box;

/* User Editable Region */

body {
  font-family: sans-serif;
  background-color: #f5f6f7;
  margin: 0;
}

/* User Editable Region */


.gallery img {
  width: 100%;
  max-width: 350px;
  height: 300px;
}

Your browser information:

User Agent is: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:122.0) Gecko/20100101 Firefox/122.0

Challenge Information:

Learn CSS Flexbox by Building a Photo Gallery - Step 12

Hi there and welcome to our community!

You have a body selector but you have also lost the closing curly bracket from the selector above it, which is why you are getting an error message.

1 Like

Haha omg thank you! Maybe I should have had a coffee before I started my lesson today. Cheers!

2 Likes

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