@ecemgo
Posted
Some recommendations regarding your code could be of interest to you.
- In order to center the card easily and correctly, you can add flexbox and
min-height: 100vh
to thebody
- If you want, you can use the recommended color for the background:
body{
/* background-color: aquamarine; */
/* padding: 50px; */
display: flex;
flex-direction: column;
justify-content: center;
align-items: center;
min-height: 100vh;
background-color: hsl(212, 45%, 89%);
}
- If you use flexbox, you don't need to give
margin
to themain
in order to center the card because flexbox in thebody
already provides it. Additionally, you don't needmin-width
. Max-width is usually used because it makes the card responsive.
main {
/* margin: auto; */
/* min-width: 450px; */
max-width: 450px;
/* padding: 25px 0px 10px 0px; */
padding: 25px 20px 10px;
}
- If you give
width: 100%
andheight: 100%
to the image, the card will be responsive and the image will be positioned completely on the card
picture > img {
/* margin: auto; */
border-radius: 15px;
display: block;
/* margin-bottom: 20px; */
/* max-width: 400px; */
height: 100%;
width: 100%;
}
- Finally, if you want to reduce the card size, you can adjust the max-width of the card and font-size of the texts.
Hope I am helpful. :)