Intro component with sign-up form with HTML, CSS, Flexbox, Grid, JS

Solution retrospective
I will be glad to any feedback!
Please log in to post a comment
Log in with GitHubCommunity feedback
- @grace-snow
A few important html tips
- you shouldn't have empty divs for any reason. If you need to put a background image on the whole page put it on the body
- every input must have a label
- the error icons are decorative so alt must be empty if placed in html. Or you could make them background images on invalid inputs if preferred
- the error messages should be wrapped in an element that has an aria live attribute on it and a unique ID for each one
- the inputs need aria describedby pointing to the id of its error container
All of these things are important habits to get into as soon as possible so you write accessible forms.
Marked as helpful - @vanzasetia
Hi, Purbo! 👋
I totally agree with @grace-snow regarding the form validation. By following Grace's suggestions, it will make the errors get announced to the screen reader users.
I wrote an article about creating accessible form validation. It will tell you how to create it step-by-step to create accessible form validation by using
aria-live
andaria-describedby
.About the
input
's label, it needs to have text content. Wrapping theinput
withlabel
doesn't make theinput
has an accessible name. I recommend having aspan
with visually hidden styling or usingaria-label
on theinput
element instead.For your information, @ is an at sign. You may need to rename the variable on JavaScript.
By default, the
body
element has16px
. I would think if thestyle-guide
is telling that thebody
font size is16px
that means it follows the users' browser's default font size. So, there's no need to specifyfont-size: 16px
.Also, code your font size in
rem
, not pixels. This means the text size will be responsive if people want to adjust the size.I hope this helps! 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