Learn CSS Grid by Building a Magazine - Step 6

Tell us what’s happening:
Describe your issue in detail here.
I don’t understand why my code does not pass. I’ve tried using img and .hero-img in the css document with both width: 400px and simply width: 400. I’ve also tried HTML styling with and although that gave the same effect the code still didn’t pass. Can anyone help?

  • List item

Your code so far

/* file: index.html */
<!DOCTYPE html>
<html lang="en">
  <meta charset="UTF-8" />
  <meta name="viewport" content="width=device-width, initial-scale=1.0" />
  <link rel="stylesheet" href="styles.css" />
    <section class="heading">
      <header class="hero">
          alt="freecodecamp logo"
        <h1 class="hero-title">OUR NEW CURRICULUM</h1>
        <p class="hero-subtitle">
          Our efforts to restructure our curriculum with a more project-based
/* file: styles.css */
.hero-img {
width: 400;
  **Your browser information:**

User Agent is: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:102.0) Gecko/20100101 Firefox/102.0

Challenge: Learn CSS Grid by Building a Magazine - Step 6

Link to the challenge:

You definitely don’t want to do this with CSS because the instructions are asking you to add a width attribute directly to the img element. Adding a width attribute is just like adding any other attribute:


You already added several attributes to the img element. Add the width attribute the same way.

1 Like

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