Design comparison
Solution retrospective
nothing to be proud of yet
What challenges did you encounter, and how did you overcome them?size A and size B are clear and understandable, but everything else between them is not yet
What specific areas of your project would you like help with?I don't understand why the button goes beyond the border
Community feedback
- @danielmrz-devPosted 7 months ago
Hello, @Marsol0!
Your project is looking fantastic!
I'd like to suggest a way to make it even better:
- Using
position
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="(min-width: 768px)" srcset="{desktop image path here}"> <img src="{mobile image path here}" alt="{alternative text here}"> </picture>
I hope this helps!
Other than that, excellent work!
Marked as helpful0 - Using
- @Omar-Ragab-ProjectsPosted 7 months ago
Great Work!
For your Q: make the container of the button relative like this
.nth-for-now { position: relative; height: 100%; }
Now you can remove the width of button safely.
:)
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