I'm trying to center my div in html code. It has image and texts also, so when I try centering it div changes it's form. I tried it by adding display: flex; in my div element but images and texts goes to one place and they cover each other.
Here is my code:
body {
background-color: #d5e1ef;
}
div {
width: 320px;
background-color: white;
border-radius: 20px;
overflow: hidden;
padding: 16px;
display: flex;
}
img {
max-width: 100%;
border-radius: 10px;
}
<div>
<img src="./image-qr-code.png" />
<h1>Improve your front-end skills by building projects</h1>
<p>
Scan the QR code to visit Frontend Mentor and take your coding skills to the next level
</p>
</div>