Hiya! Each time I go to add the margin-left and margin-right lines to center the div, one of these lines never seems to “work” (when the line of code turns the appropriate color, such as red or blue, this is how I know it took, so to speak).
I’ll type the code out just like every other line, yet it doesn’t seem to register. Am I doing something wrong, or is this a fluke issue?
Here is a photo of my code in the program. Is this formatted properly? It feels like it is formatted correctly, but for some reason will not work.
Please let me know if I am just making a silly mistake!
Thanks!
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>
<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 */
div {
width: 80%;
background-color: burlywood;
margin-left: auto
}
/* User Editable Region */
Your browser information:
User Agent is: Mozilla/5.0 (iPhone; CPU iPhone OS 16_2 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/16.2 Mobile/15E148 Safari/604.1
Challenge: Learn Basic CSS by Building a Cafe Menu - Step 25
Link to the challenge: