Design comparison
Solution retrospective
Hello fellow devs, Positioning the image was tricky. And the javascript for the accordion can be refactored in a better, more efficient way - any suggestions on this will be appreciated! Thanks :)
Community feedback
- @vanzasetiaPosted over 1 year ago
Hi, Ar! π
You should not add the click event to the arrow icon. Not to mention that it has a small target size which does not satisfy the 2.5.5 Target Size.
Understanding Success Criterion 2.5.5: Target Size | WAI | W3C
I recommend using the native HTML elements for the accordion. This way, you don't have to create the open-close functionality. All you need to do within the JavaScript is to ensure that the users can only open one accordion panel at a time.
The arrow icons are decorative images. I suggest leaving the alternative text empty.
For the arrow icons, I recommend rotating them using
transform: rotate()
instead of having two separate icons. You should just rotate the icon when the accordion state is changed.I hope you find this useful. Have fun coding! π
Marked as helpful1 - @Finney06Posted over 1 year ago
Hello there π. Good job on completing the challenge !
Here are some suggestions regarding your code that may be of interest to you.
HTML π·οΈ:
To clear the Accessibility report:
-
Wrap the page's whole main content in the
<main>
tag. -
Always avoid skipping heading levels; Starting with
<h1>
and working your way down the heading levels (<h2>
,<h3>
, etc.) helps ensure that your document has a clear and consistent hierarchy. -
Use HTML5 semantic elements such as
<header>
,<nav>
,<main>
,<aside>
, and<footer>
to define these sections. -
Use ARIA landmarks such as
<header role="banner">
and<footer role="contentinfo">
to provide additional information about the purpose of each section to assistive technologies.
Here is a web accessibility evaluation toolπ to check your webpage for any remaining errors or warnings related to landmarks.
I hope you find it helpful!π Above all, the solution you submitted is π. πHappy coding!
Marked as helpful1 -
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