Hi Jessie,
It's amazing that you manage to create this awesome looking card when you just a week into this. Way to go !
I have taken a look at your index.html
file, and I have a few suggestion and answer for your question.
Is there another way to make the what box around the image other than what I did?
Yes, and this should be made using padding
, since it is the way CSS makers give for exactly this kind of design. It gives an inside space, between border and the content. So, instead of giving margin: auto
to your img
, you should give your .box
class a padding
. You can write :
.box {
padding: 15px
}
I'm not sure about how much px is correct for this design, you can change it as you like.
I also used <br> to create the text-wrap effect however, agin i'm not sure if thats the way to go about it.
Sure, using <br>
is acceptable method for text-wrap. Me and my coworkers still used it in our day to day job. So no problem with that.
I have a few more suggestions, but it's totally optional for you to implement it.
Firstly, the card is in the center of the viewport in the design. The easiest way to position it is using flex
in your parent element (body
in this case). Like so :
body {
display: flex;
justify-content: center;
align-items: center
}
This should nicely center your card.
Secondly, I notice that the font used is not the same as the design. I took a look at the challenge's style-guide
is Outfit
(https://fonts.google.com/specimen/Outfit). You can easily change this by including link
tag to this Google Font and paste it anywhere inside your HTML's <head>
tag. Here I copied the link for you :
<link href="https://fonts.googleapis.com/css2?family=Outfit:wght@400;600;700&display=swap" rel="stylesheet">
Just paste it inside your <head>
tag. Finally, you need to use the font-family
in your CSS. In this case because the design only has one font, you can add it globally in your body
selector like so :
body {
...your CSS...
font-family: 'Outfit'
}
And the font should change.
That's all. Just DM me if any of my suggestion is not working properly.
Good luck !