Below is my CSS and HTML respectively:
body {
display: flex;
background-color: #333;
height: 100%;
margin: 0;
padding: 0;
align-items: center;
justify-content: center;
}
div {
width: 170px;
height: 170px;
background-color: #0073d9;
}
<html>
<body>
<div></div>
</body>
</html>
I know this is a simple question, but I just cannot fix it. I have put the align-items property and assigned "center" value to the body, I don't understand why the 170px by 170px square still can't be placed in center vertically.
I will be grateful if you can let me know where I get wrong. Thanks very much.