Design comparison
Solution retrospective
I haven't sat down to write code in quite a while, so I'm really proud of how much i remember from my studies.
What challenges did you encounter, and how did you overcome them?I struggled a bit with getting the exact paragraph formatting as seen in the original design. When the window is resized, my text doesn't take the exact shape like the design.
What specific areas of your project would you like help with?How to properly format the text in my work to be structured just like the text was in the original design.
Community feedback
- @danielmrz-devPosted 8 months ago
Hello, @nyarkoohene!
Your project is looking fantastic!
I'd like to suggest a few things to make it even better:
- Using
margin
isn't always the most effective method for centering an element.
Here's a highly efficient approach to position an element at the center of the page both vertically and horizontally:
š Apply this CSS to the body (avoid using
position
ormargins
in order to work correctly):body { min-height: 100vh; display: flex; justify-content: center; align-items: center; }
š Also, you can use the
<picture>
tag when you have different versions of the same image.Using the
<picture>
tag will help load the correct image to the user's device, saving bandwidth and improving performance.Example:
<picture> <source media="(max-width: 460px)" srcset="{desktop image path here}"> <img src="{mobile image path here}" alt="{alternative text here}"> </picture>
I hope you find this helpful!
Keep up the excellent work!
Marked as helpful0@nyarkoohenePosted 8 months ago@danielmrz-dev thanks a lot. particularly for the tip using the <picture>. I was thinking of how to achieve it but it was only JS that kept coming to mind. Learnt something new.
0 - Using
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