Hi, i am just started learning how to make a simple website and for sake of learning creating a fake business website. I am trying to get my divs to all be centered by using margin: auto, but haven’t been able to get it to work and the divs stick to the left side.
<!DOCTYPE html>
<html lang="en">
<head>
<title>Lil Mafe</title>
<style>
body{
font-family: 'Trebuchet MS', 'Lucida Sans Unicode', 'Lucida Grande', 'Lucida Sans', Arial, sans-serif;
}
header{
background: lightcoral;
color: white;
border-radius: 5px;
padding:25px;
}
section{
background: rgb(255, 236, 207);
padding: 25px;
display: flex;
flex-direction: row;
}
ul{
margin: 0px;
padding: 0px;
list-style-type: none;;
}
li{
display: inline-block;
margin-right: 20px;
}
div{
background: rgb(255, 218, 118);
margin: auto;
display: inline-block;
width: 150px;
text-align: center;
}
footer{
background:rgb(137, 225, 255);
padding: 5px;
border-radius: 5px;
}
</style>
</head>
<body>
<header>
<nav>
<ul>
<li>Home</li>
<li>Locations</li>
<li>Contact</li>
</ul>
</nav>
<h1>Mafe's Cafe</h1>
</header>
<div>Foods</div>
<div>Drinks</div>
<div>Desserts</div>
<section>More Info</section>
<footer>© 2018 Mafe Inc.</footer>
</body>
</html>