Learn Basic CSS by Building a Cafe Menu - Step 18

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

Your code so far
Idk how to change the background color wuth body element , help pls ?

<!-- 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>Cafe Menu</title>
    <link href="styles.css" rel="stylesheet"/>
  </head>
  <body>
    <main>
      <h1>CAMPER CAFE</h1>
      <p>Est. 2020</p>
      <section>
        <h2>Coffee</h2>
      </section>
    </main>
  </body>
</html>
/* file: styles.css */

/* User Editable Region */


h1, h2, p {
  text-align: center; 
}


/* User Editable Region */


Your browser information:

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

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

Link to the challenge:

Please describe what you need help with :slight_smile:

they want from me to change background colour , and i am asking someone to show me how

I’m afraid giving answers is not really helping.

but I can lead you to the answer.

unfortunately, I cant see what you’ve attempted. so dont know what it is your having trouble with :frowning:

could you show me or explain what you have tried already?


i tried this

You seem to be having a syntax problem.

html and css are slightly different.

when writing in html, you use tags <h1></h1>

but in css you use selectors
for example, to select the ‘h1’ tag,
you specify the tag using its name

h1  {
    text-align: center;
    font-size: 16px;
}

use the curly brackets { } to instruct how the html document is to be styled.

tnks
but it want from me to use body selector , what is that

look at your html document

is there a tag with the name ‘body’ ?

if so you can select it.

remember to select a tag in css you must use the tag name then the curly brackets with the styles between them

1 Like

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