Learn Basic CSS by building a Cafe Menu: Step 27

Hello! I’m having a problem with this task:
To apply the class’s styling to the div element, add a class attribute to the div element’s opening tag and set its value to menu .
My code is:
< div class=“menu” >

But that is not accepted. What am I doing wrong?

Please provide a link to the Step you are working on. Thanks

Sure. https://www.freecodecamp.org/learn/2022/responsive-web-design/learn-basic-css-by-building-a-cafe-menu/step-27

Your code looks correct to me, but you have an extra space after the < bracket. If you added the space to make the code show on the post, please post your full code.

Also when you enter a code block into a forum post, please precede it with a separate line of three backticks and follow it with a separate line of three backticks to make it easier to read. You can also use the “preformatted text” tool in the editor (</> ) to add backticks around text.

Oh, thanks for the tip! Here’s the code:

<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="utf-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>Cafe Menu</title>
    <link href="styles.css" rel="stylesheet"/>
  </head>
  <body>
    <div class='menu'>
      <main>
        <h1>CAMPER CAFE</h1>
        <p>Est. 2020</p>
        <section>
          <h2>Coffee</h2>
        </section>
      </main>
    </div>
  </body>
</html>

Your solution works from my end. Please try one of the following steps to move forward.

Click on the “Restart Step” button and force a refresh of your page with CTRL + F5 then try to paste the code in again.

or - Try the step in incognito or private mode.

or - Disable any/all extensions that interface with the freeCodeCamp website (such as Dark Mode, Ad Blockers, or Spellcheckers), and set your browser zoom level to 100%. Both of these factors can cause tests to fail erroneously.

or - Ensure your browser is up-to-date or try a different browser.

I hope one of these will work for you.

1 Like

Thanks a lot! The problem was in a Grammarly extension :slight_smile:

1 Like