used html,css,JavaScript created static web page for tip calculation

Solution retrospective
while working on this project it was hard to align the ever thing in order for mobile view. and there are some mistakes in mobile view it might be good on 320px not on 425px . first time used onclick event in this project and used event listener "change" in custom option . custom is created using the input element. and claculation might be different i did based on my knowledge.
Please log in to post a comment
Log in with GitHubCommunity feedback
- @AdrianoEscarabote
Hi Saravana Kumar, how are you? Welcome to the front-end mentor community! I really liked the result of your project, but I have some tips that I think you will enjoy:
A good practice to center content is using
grid
orflex-box
, avoid using margin or padding to make placements, use only in the latter case! we can do it like this:Flex-box:
body { display: flex; align-items: center; justify-content: center; flex-direction: column; min height: 100vh; }
GRID
body { display: grid; min height: 100vh; place-content: center; }
To improve the code structure wrap this div:
<div class="attribution">
with the semantic tag
footer
The rest is great!
I hope it helps... 👍
Marked as helpful - @Deevyn9
Hi Saravana, congrats on completing this project, your solution looks really great. Although I found the following issues:
- The calculation for the Tip and Total amounts aren't accurate.
- The Error messages don't clear out when the reset function is triggered.
- The container isn't centered vertically, this can be fixed using
body { display: grid; place-items: center; }
- I also noticed that you didn't use the design for the mobile view and it makes it hard to use on small screens.
If you have issues trying to fix these issues, you can use my solution
I hope you find this helpful.
Happy Coding! 🎉
Marked as helpful
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