Design comparison
SolutionDesign
Solution retrospective
Thanks for any feedback
Community feedback
- @vanzasetiaPosted about 2 years ago
Hello @arpollla! 👋
Here are some suggestions for improvements.
- The form is currently inaccessible, users can't interact with submit button using the keyboard or screen readers, there is no label for the input, and much more. I recommend making the following changes.
- Wrap all the inputs and the submit button with a
form
element. This will make those inputs connected to each other. It means that the users can useEnter
key to fill in the required input (or in other wordsinput
that hasrequired
attribute). - Use
button
withtype="submit"
for the submit button. Usingdiv
will not make it behaves likebutton
element. The users can't interact with it withTab
andEnter
keys. Also, the screen readers won't pronounce it as a button. input
must have label or accessible name. You can usearia-label
to provide a label for eachinput
(aria-label="Email"
). This way, the screen readers know how to pronounce theinput
.- Specify the correct
type
for eachinput
. This helps mobile users to get the right keyboard layout for different types of input. - Add
required
attribute to tell the users that the input must be filled.
- Wrap all the inputs and the submit button with a
- I suggest making the error icon as the background image of the
input
. - I recommend reading the "How To Create Accessible Form with Boring Design?" article. It tells about how to create accessible form validation by using
aria-live
andaria-describedby
. It also tells you about my process of writing HTML, CSS, and JavaScript with some best practices. - Avoid using JavaScript to add styling (unless you have no other option). JavaScript allows you to change the CSS code using the
style
property. But, to make debugging easier and improve code maintainability, it’s best to avoid it. Use CSS classes instead. - Use single class selectors for styling whenever possible instead of
id
.id
has high specificity which can lead to a lot of issues on the larger project. It's best to keep the CSS specificity as low and flat as possible.
I have three recommended videos. The first one tells how hard HTML is (HTML is not easy). The other two talk about modern CSS techniques and approaches.
- Manuel Matuzović - Lost in Translation - YouTube
- Andy Bell – Be the browser’s mentor, not its micromanager - YouTube
- Stephanie Eeckles - Scaling CSS Layout Beyond Pixels - YouTube
I hope this helps! Happy coding!
Marked as helpful1 - The form is currently inaccessible, users can't interact with submit button using the keyboard or screen readers, there is no label for the input, and much more. I recommend making the following changes.
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