Learn Basic CSS by Building a Cafe Menu - Step 4

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

  **Your code so far**
<!DOCTYPE html>
<html lang="en">
<head><body>
  <meta charset="utf-8" />
  <title>Cafe Menu</title>
</head></body>
</html>

Hello, I would like to know where I suppose to put my </body> , I already did after the open one, bellow the </head> as a side but the msg I’m receiving is : " Your body element should come after your head element."

Thanks!

  **Your browser information:**

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

Challenge: Learn Basic CSS by Building a Cafe Menu - Step 4

Link to the challenge:

@Foote_ka hey you have put head tag and body tag in wrong way

you can learn more Getting started with HTML - Learn web development | MDN

I have edited your post for readability.
When posting any code snippets, please enclose them in backticks. like this:
```
code
```
or a single backtick if the code is in-line like this
`<html>`

1 Like

Most elements have both an opening tag and a closing tag. The opening tag for the body element has to come afher the entire (both opening and closing tag) head element.

So I already try bellow to the head, how is the correct away ?

I did try it and still not working


  <head><Body></body>
    <meta charset="utf-8" />
    <title>Cafe Menu</title>
  </head>

the msg still the same.

@Foote_ka now let explain in detail

Take html boilerplate as the tree structure
here html tag is most senior member of the tree

  • if we go next within html tag there are two child i.e head and body
  • head tag has meta data and title tag.
  • body tag has all element of the body section like heading,div,p and so on.

Is this after the closing head tag?

Also, keep everything lowercase here.

I’ve edited your code for readability. 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.

See this post to find the backtick on your keyboard.
Note: Backticks (`) are not single quotes (').

1 Like

Yes, I did try lowercase too.
side by side
side and bellow to close head tag.
What are you saying is, the solutions is open body tag and close body tag in the same line of the open head tag, right ?
I did try it and still saying: " Your body element should come after your head element.

@Foote_ka please separate the body and head because it is an individual tag

I did and still the same

@Foote_ka you can reference Basic HTML5 Template: Use This HTML Boilerplate as a Starter for Any Web Dev Project

What does your code look like with the body element after the closing head tag?

Same msg : Your body element should come after your head element.

I mean, what is your actual code? Not the error message.

<head><body>
    <meta charset="utf-8" />
    <title>Cafe Menu</title>
  </head></body>

Can you identify the closing head tag in your code? The opening body tag must come after the closing head tag. Then, the closing body tag must come immediately after the opening body tag.

Which tag do you think is the closing head tag?

1 Like

I got ! I don’t know why I though was bellow to the initial head tag, the exercise was talking about it.
Thank you so much !

Good work figuring it out!