I need some help centering some of my code. I'm not sure if I may have used the wrong centering method but it's not quite working for me. It's HTML code but meant to be coded for mobile use. The problem with my code is that the button container won't center to the screen and stays left-aligned.
.btn-container {
margin: 0 auto;
align-content: center;
display: flex;
border: none;
}
.btn-group button {
width: 150px;
height: 120px;
display: flex;
justify-content: center;
background-color: #404040;
border: none;
margin: 10px;
cursor: pointer;
float: left;
}
.btn-group button:not(:last-child) {
border-right: none;
/* Prevent double borders */
}
/* Clear floats (clearfix hack) */
.btn-group:after {
content: "";
clear: both;
display: table;
}
<body>
<div class="destination-title">
<a>Choose Your Destination</a>
</div>
<div class="btn-container">
<div class="btn-group">
<button>Opt 1</button>
<button>Opt 2</button>
<button>Opt 3</button>
<button>Opt 4</button>
<button>Opt 5</button>
<button>Opt 6</button>
</div>
</div>
<div class="button-divider"></div>
<div>
<button class="continue-button"> <ahref="customize.html">Continue</a></button>
</div>
</body>