@ecemgo
Posted
Some recommendations regarding your code that could be of interest to you.
- For the font-family to work correctly, add the following between the
<head>
tags in HTML:
<link rel="preconnect" href="https://fonts.googleapis.com">
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
<link href="https://fonts.googleapis.com/css2?family=Outfit:wght@400;700&display=swap" rel="stylesheet">
- You can center it easily, so I recommend you to use flexbox in the
body
. - If you want, you can also use the recommended font-family and color for the background in
body
:
body{
/* background: hsl(228, 13%, 92%); */
/* padding: 30px; */
/* height: auto; */
min-height: 100vh;
display: flex;
justify-content: center;
align-items: center;
background-color: hsl(212, 45%, 89%); // the recommended color
font-family: 'Outfit', sans-serif; // google fonts which is suggested
}
- after using flexbox, you don't need to use
margin
in the#box
:
#box{
background-color: white ;
/* margin-left: 40%; */
/* margin-right: 40%; */
/* width: 25%; */
max-width: 280px; // max-width makes it responsive & 280px is ideal for the card
height: 69vh;
border-radius: 19px;
}
- You'd better improve the
padding
andwidth
of the image in this way:
img{
display: block;
margin-left: auto;
margin-right: auto;
/* width: 81%; */
width: 90%;
/* margin-top: 30px; */
/* padding: 14px; */
padding: 14px 5px;
border-radius: 16%;
}
- finally, you don't need
.container
because thebody
already represents the outside of the card in this solution, you can delete.container
from CSS.
Hope I am helpful. :)
Marked as helpful