Tell us what’s happening:
I have tried many different ways of doing this but everytime it tells me I should set the margin-left property to auto but I can’t figure out how to
Your code so far
<!-- 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>
<div id="menu">
<main>
<h1>CAMPER CAFE</h1>
<p>Est. 2020</p>
<section>
<h2>Coffee</h2>
</section>
</main>
</div>
</body>
</html>
/* file: styles.css */
body {
/*
background-color: burlywood;
*/
}
h1, h2, p {
text-align: center;
}
/* User Editable Region */
#menu {
width: 80%;
background-color: burlywood;
{margin-left: auto;}
/* User Editable Region */
Your browser information:
User Agent is: Mozilla/5.0 (X11; CrOS x86_64 14541.0.0) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/125.0.0.0 Safari/537.36
Challenge Information:
Learn Basic CSS by Building a Cafe Menu - Step 25
1 Like
The instructions say to change both margin-left and margin-right to auto. Yo u have only done one. You also have a stray opening curly brace in the middle of the #menu properties.
1 Like
sanderssl627:
{margin-left: auto;
Why did you added the curly brace {
.
1 Like
i have removed the {, and added in the margin-right: auto; but it is still saying that i need to set margin-left to auto
1 Like
I can’t see, what you did. Post your updated code.
1 Like
#menu
width: 80%;
background-color: burlywood;
margin-left: auto;
margin-right: auto;
I can’t see your code properly in the post. Add Three back ticks (```)
in a separate line before and after your code block.
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 (').
You removed ALL the curly braces.
Look at your other css to see the format.
1 Like
system
Closed
December 29, 2024, 1:46am
11
This topic was automatically closed 182 days after the last reply. New replies are no longer allowed.