My div
is set to have a margin:auto
, but the h1
inside is not centered as expected. I've tried various solutions, but none seem to work. Can someone please help me get it centered properly?
body {
background: #5D6D7E;
color: white;
font-family: "Varela Round", sans-serif;
margin: 0;
padding: 0;
}
header {
background: white;
color: #3498DB;
}
ul {
list-style-type: none;
}
li {
display: inline-block;
margin-right: 20px;
}
a {
color: #D7DBDD;
font-weight: bold;
}
a:hover {
color: white;
}
section {
display: flex;
flex-direction: row;
}
div {
width: 100px;
margin: auto;
}
.title {
/* Isn't centered */
font-size: 50px;
}
header,
section {
background: #2E86C1;
}
header,
section,
footer {
padding: 20px;
}
<section>
<div class="title">
Brainstorm
</div>
</section>