Design comparison
Solution retrospective
I edited my solution by deleting unnecessary divs per advice from @correlucas. Thanks again, @correlucas π
Community feedback
- @correlucasPosted over 2 years ago
πΎHello Cristina, congratulations for your new solution!
I've check your code and I've some tips for you:
The background should go inside the body and not the container, this way you've it display full width/height.
body { background-color: #d6e2f0; font-family: "Outfit", sans-serif; } .main { /* background-color: #d6e2f0; */ margin-top: 80px; width: 90%; padding: 10px 0 100px 0; /* box-shadow: 0 20px 20px 5px rgb(0 0 0 / 5%); */ border-radius: 10px; } .container { box-shadow: 0 20px 20px 5px rgb(0 0 0 / 5%); display: flex; justify-content: center; align-items: center; width: 100%; max-width: 230px; background-color: #fff; text-align: center; border-radius: 10px; margin-top: 100px; box-shadow: 0 20px 20px 5px rgb(0 0 0 / 5%); }
You can build this with a simple approach, without using unnecessary divs, all you need is a single
<main>
or<div>
to keep all the content inside, and nothing more. The ideal structure is thediv
and only the image, heading and paragraph.See the structure below:
<body> <main> <img> <h1></h1> <p></p> </main> </body>
π I hope this helps you and happy coding!
Marked as helpful0@codercreativePosted over 2 years ago@correlucas Thank you so much for taking the time to review my code! I will go back and implement your suggestions. Cheers π
0
Please log in to post a comment
Log in with GitHubJoin our Discord community
Join thousands of Frontend Mentor community members taking the challenges, sharing resources, helping each other, and chatting about all things front-end!
Join our Discord