Order summary component

Solution retrospective
Solution according to Mobile-first workflow
Feedback and tips are welcomed
Please log in to post a comment
Log in with GitHubCommunity feedback
- @0xabdulkhaliq
Hello there 👋. Congratulations on successfully completing the challenge! 🎉
- I have other recommendations regarding your code that I believe will be of great interest to you.
BODY MEASUREMENTS 📐:
- The measurement of
lvh
is for only mobile devices, for desktops it don't have any effect asvh
- Then, you can use
min-height: 100vh
forbody
instead ofheight: 100lvh
. Setting theheight: 100lvh
may result in the component being cut off on smaller screens, such as mobile devices in landscape orientation
- For example; if we set
height: 100lvh
then thebody
will have100lvh
height no matter what. Even if the content spans more than100vh
of viewport.
- But if we set
min-height: 100vh
then thebody
will start at100vh
, if the content pushes thebody
beyond100vh
it will continue growing. However if you have content that takes less than100vh
it will still take100vh
in space.
.
I hope you find this helpful 😄 Above all, the solution you submitted is great !
Happy coding!
Marked as helpful - @basitkorai
Hello, my friend.
I'm really glad you completed the project.
Here are some suggestions to improve it:
HTML
- Wrap your component in an
<article>...</article>
element.
CSS
- Try this to prevent the card from hitting the edges of the screen
article { width: 80%; max-width: 23.4375rem; // (375px) as given in the style-guide // these values are not hard and fast rules, just an example, try to adjust the width and max-width and see what works best for your project. }
- Add these styles to the <main> instead after adding the
<article>...</article>
for centering the component
main { height: 100vh; display: grid; place-content: center; }
I hope these tips will help you improve your project
Happy Coding✌️
Marked as helpful - Wrap your component in an
- @kubas33
Hi! Thanks to your suggestion, appreciate it.
But can you tell me why you suggest to wrap content with article? I am trying to understand this so I know when to use this or not. I thought it isn't necessery to wrap component into another tag if there is only one section.
Join 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