Responsive using vanilla js and media queries

Solution retrospective
Phew this project really gave me a lot of headache, BUT it was all worth the knowledge i gained for the problems i faced. Even though i gave it my all there are many thing that could be improved. I would be really grateful for any advice anyone have for me.
Please log in to post a comment
Log in with GitHubCommunity feedback
- @Kristiana12
Hey @Akunamo,
I did the same challenge, and I got a headache too, for almost a week. But I also learned a lot and would like to share my knowledge with you:
About the layout:
- When using
position: absolute
with left/right in %, you should be careful because they might not look that good on bigger screens. Making an extra breaking point with fixed values should solve that problem. - About the logo, what you did was clever, but in the files, there was a logo SVG file, which you could have used to spare you some code and time
- You could add some hover and active effect on your submit button
About the Form:
- I would read the HTML issues listed and fix them. (you learn a lot through mistakes)
- Input type number, unfortunately, does not support maxlength and pattern attributes. I switched to input
type=" text"
cause I couldn't find another solution. - I would consider adding some more conditions, for example: no numbers allowed on the cardholder's name field, where you expect numbers (month, year, CVC), maybe also show errors. (I used regular expressions to solve this problem via js)
- And also restrict the maxlength of the inputs, via
type=" text" maxlength="2"
I hope some of these suggestions might help you and give you some new ideas for your project!
Happy Coding!
Marked as helpful - When using
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