Add justify-content: center
to .container-master
. Also, add this ruleset to your css:
.containter-child {
flex-direction: column;
display: inherit;
}
Do you need such a result?
body{
width: 100%;
background-color: red;
}
.header-1 {
font-family: 'Franklin Gothic Medium', 'Arial Narrow', Arial, sans-serif;
color: aliceblue;
text-align: center;
}
h2 {
text-align: center;
margin-top: 5%;
}
#submit {
width: 70px;
height: 20px;
}
.container-master {
margin: 5%;
display: flex;
justify-content: center;
}
.containter-child {
flex-direction: column;
display: inherit;
}
li {
display: inline;
}
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Guessing Game</title>
<link rel="stylesheet" href="main.css">
</head>
<body>
<h1 class="header-1">Johnny's Guessing Game</h1>
<h2>Previous Guesses</h2>
<div class="container-1">
<ul id="guessList">
<ll id = "listItem"> </ll>
</ul>
</div>
<div class="container-master">
<div class="containter-child">
<input type = 'text' id="guessBox" placeholder="Enter Guess Here">
<button id="submit">Submit</button>
</div>
</div>
<h4 id="error"></h4>
<script src="js/guessing-game.js"></script>
</body>
</html>