Build a Recipe Page - Build a Recipe Page

Tell us what’s happening:

Not sure where I have gone wrong, maybe someone can take a look at this for me?

Your code so far

<!DOCTYPE html>
 <html lang="en">
  <head>
    <title>Cookie Cake Recipe</title>
  </head>
      <meta charset="UTF-8">
      <body>
        <h1>Cookie cake</h1>
        <p>chocolate chips</p>
        <h2>Ingredients</h2>
        <ul>
          <li>chocolate chips</li>
          <li>flour</li>
          <li>sugar</li>
          <li>butter</li>
          <h2>Instructions</h2>
          <ol>
            <li>add the ingredients</li>
            <li>mix the ingredients</li>
            <li>put onto baking sheet</li>
            <li>bake in oven</li>
          <img src="https://cdn.freecodecamp.org/curriculum/labs/recipe.jpg" alt="Cookie Cake"

Your browser information:

User Agent is: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/138.0.0.0 Safari/537.36

Challenge Information:

Build a Recipe Page - Build a Recipe Page

You’ve seemed to not closed your body element nor your img element.

Additionally your meta element should be inside your head element.

1 Like

use an html validator: Ready to check - Nu Html Checker

Thx, I went back and fixed the img part, the issue still seems to be at the beginning. it isn’t accepting the part where I put < html lang=“en” >

Tell us what’s happening:

Okay, so I fixed several things already but it still doesn’t accept it completely. I wonder where I went wrong…?

Your code so far

<!DOCTYPE html>
<html lang="en">
<head>
<title>Cookie Cake Recipe</title>
<meta charset="UTF-8">
</head>

  <body>
        <h1>Cookie cake</h1>
        <p>chocolate chips</p>
        <h2>Ingredients</h2>
        <ul>
          <li>chocolate chips</li>
          <li>flour</li>
          <li>sugar</li>
          <li>butter</li>
  <h2>Instructions</h2>
        <ol>
          <li>add the ingredients</li>
            <li>mix the ingredients</li>
            <li>put onto baking sheet</li>
            <li>bake in oven</li>
          <img src="https://cdn.freecodecamp.org/curriculum/labs/recipe.jpg" alt="Cookie Cake">

Your browser information:

User Agent is: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/138.0.0.0 Safari/537.36

Challenge Information:

Build a Recipe Page - Build a Recipe Page

These are the errors that I am getting.

  • Failed:2. You should have an html element with lang set to en.
  • Failed:3. You should have a head element within the html element.
  • Failed:8. You should have a body element within your html element.

what does the html validator say? did you test your code with that?

Sorry about that, it was an accident. Do you have any idea why it would be still telling me these errors?

  • Failed:2. You should have an html element with lang set to en.
  • Failed:3. You should have a head element within the html element.
    *Failed:8. You should have a body element within your html element.

I don’t quite understand since it doesn’t seem to be anything wrong with the code except for the beginning steps.

it says that h2 is not allowed as a child of ul, so look at your ul
is there something there that needs fixing?

put that together with error number 5, unclosed ul element

1 Like

Thank you, after taking a step away from it and coming back to it, I fixed it! Your suggestion really helped and made me realize some other things that I didn’t do.