Hello everyone. I need help with step 12

Tell us what’s happening:

How do I add style to an element by specifying it in the style element and setting a property for it like this:

element {
 property: value;
}
  **Your code so far**

<!DOCTYPE html>
<html>
<head>
  <meta charset="utf-8" />
  <title>Cafe Menu</title>
  <style>
  <h1> element{property: value;}</h1>
  </style>
</head>
<body>
  <header>
    <h1>CAMPER CAFE</h1>
    <p>Est. 2020</p>
  </header>
  <main>
    <section>
      <h2>Coffee</h2>
    </section>
  </main>
</body>
<html>
  **Your browser information:**

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

Challenge: Step 12

Link to the challenge:

1 Like

You need to style the h1 element here

Correct Syntax:

element {
 property: value;
}

element being: h1
property being: text-align
value being: center

1 Like

This is how you do styling:


Mod Edit: Solution removed

@harford
I’m sorry, I was in a hurry yesterday.
So basically, inside that style tag. We can use the name of an HTML tag/ IdName/ ClassName to target that particular element.
We use curly brackets to assign the style we wanna assign.

Above is an example.

Try doing different things. Break the code. This way, you’ll learn better.

The “example” you gave doesn’t look like an example to me. It looks more like the solution to me.

It is great that you solved the challenge, but instead of posting your full working solution, it is best to stay focused on answering the original poster’s question(s) and help guide them with hints and suggestions to solve their own issues with the challenge.

We are trying to cut back on the number of spoiler solutions found on the forum and instead focus on helping other campers with their questions and definitely not posting full working solutions.

1 Like

I’m really sorry. I came back and explained the same code to him.
I’ll not repeat the same in the future.

I also want to apologize on his behalf. I have already solved the code way before @HarshJohn replied the final time. Dude is truly awesome.

can u give me a clue on how u do it cos have tried and is still not working…you don’t have to show me the solution. just explain and i will understand

You need to style the h1 element here

Correct Syntax:

element {
 property: value;
}

Someone explained this above. Hope I understood your question.

have tried it but is not working

Ok let me explain by clarifying the hint.
So element = <style> (opening tag) </style> (closing tag)
property = text-align
value = center
Try plugging that in please.

You can add style to an element by specifying it in the style

This is the given clue;
element { property: value; }

element being: h1
property being: text-align
value being: center

And I notice this in your code;

PLEASE CHECK CAREFULLY WHAT YOU SHOULDN’T HAVE ADDED.

1 Like