Hello Anthony!!, congrats on completing this challenge. Here are some tips to make your code better.
-
To center your card horizontally and vertically, you need to wrap all your contents in a container, preferrably a div with the class name card or whatever works for you. You can then simply make use of flexbox on it's direct parent which in your case will be the <body>. Your code will look like so:
body { display: flex; justify-content: center; align-items: center; min-height: 100vh; // This will make your card sit in the middle of your viewport without vertical scrolling. padding: 3rem 2rem; // Add padding on it's direct parent to avoid your container from touching the top, bottom and sides of the screen for mobile view. }
-
Your card should equally contain two divs: one for the image and another for the text i.e card-image and card-text respectively. You can then use flexbox to arrange them like so:
.card { display: flex; flex-direction: column; }
-
Try to add classes as much as possible. The specificity will make your life easier as a frontend developer.
-
Developers seldom use tags like strong. Make use of the header tags like <h1>, <h2> and the likes and add appropriate font-size and font-weights with their colors. Your code must contain at least one of these in the right order.
-
Always apply this reset for images:
img { display: block; max-width: 100%; }
This will keep your image inside its container at full width. Look up other css resets and apply them. Here's one: css resets
-
Please pay attention to the accessibility and validation reports on frontend mentor.
I hope you find this helpful. Happy coding.