@correlucas
Posted
๐พHello Hakizimana, congratulations for your first solution and ๐ welcome to the Frontend Mentor Coding Community!
I saw that you've used position: absolute; left: 40.25%; top: 15.25%;
to try to align. My advice for your is to use flexbox to create this alignment. For example, first of all add to the body
min-height: 100vh
to make the body display 100% of the browser screen size and display: flex
e flex-direction: column
to align the child element (the container) vertically using the body.
body {
min-height: 100vh;
background-color: hsl(212, 45%, 89%);
font-family: "Outfit", serif;
text-align: center;
display: flex;
align-items: center;
justify-content: center;
}
Remove these properties to make the alignment work:
.square {
max-width: 258px;
/* height: 424px; */
background-color: hsl(0, 0%, 100%);
/* position: absolute; */
/* left: 40.25%; */
/* top: 15.25%; */
border-radius: 3%;
/* padding: 0 10px 10px; */
}
To make your image fully responsive add display: block
and max-width: 100%
:
img {
max-width: 100%;
display: block;
border-radius: 3%;
/* width: 250px; */
/* height: 250px; */
/* position: relative; */
/* top: 3.625%; */
/* margin-bottom: 10.625%; */
}
๐ I hope this helps you and happy coding!
Marked as helpful
@Hakizimana-Clement
Posted
@correlucas whoah whoah! first of all Thank you for welcoming me. Your support matters a lot to me and I will begin to use it.
Thank You & Happy coding ๐