The container is not stack at the center of the body
HTML code:-
<body>
<div class="container">
<div class="image">
<img src="./images/image-qr-code.png" alt="qrcode">
</div>
<div class="heading">
<h2>Improve your front-end skills by building projects</h2>
<p>Scan the QR code to visit Frontend Mentor and take your coding skills to the next level</p>
</div>
</div>
</body>
CSS code:-
.container{
background-color: white;
display: flex;
flex-direction: column;
justify-content: center;
align-items: center;
max-width: 400px;
padding: 10px;
border-radius: 18px;
text-align: center;
}
I tried to move the container div to the center but it is not getting stack at the center
2
Answers
As you want the container in the center you need to wrap that div in the other div and make it flex and justify-content:center
Setting the margin property to auto may help to resolve your issue.