Design comparison
Solution retrospective
Simple love it. Very nice Challenge. This is my firstime js deploying. I tried to maximum perfection.
Community feedback
- @VCaramesPosted almost 2 years ago
Hey there! 👋 Here is some feedback to further improve your code:
- The
section
element is being used incorrectly ⚠️ and not needed for this challenge.
- The “icons/illustrations” in this component are purely decorative. ⚠️ Their
alt tag
should be left blank to hide them from assistive technology.
More Info:📚
https://www.w3.org/WAI/tutorials/images/
- The HTML for the ratings needs to be rewritten as it was done incorrectly ❌:
To ensure that the "rating buttons" are fully accessible 💯, they need to be built using a
form
⚠️.- Everything will be wrapped inside a
fieldset
which will have alegend
that is visually hidden using CSS. - Inside, there should be five
input radios
and eachinput
should have alabel
attached to it to make the “ratings” accessible. - The last thing you will want to include will be a
button
so users can submit their choice.
More Info: 📚
If you have any questions or need further clarification, you can always check out my submission and/or feel free to reach out to me.
Happy Coding! 🤖
Marked as helpful1@Mirjax2000Posted almost 2 years ago@vcarames your solutions is breath taking.
where can i evaluate HTML rating?
1@VCaramesPosted almost 2 years ago@Mirjax2000
Do you mean how to get the rating value?
0@VCaramesPosted almost 2 years ago@Mirjax2000
Give each input the
name="rating"
and for your JS useconst rating = form.rating.value;
Marked as helpful0@Mirjax2000Posted almost 2 years ago@vcarames idont understand this css code for .visually-hidden { border: 0 !important; clip: rect(1px, 1px, 1px, 1px) !important; -webkit-clip-path: inset(50%) !important; clip-path: inset(50%) !important; height: 1px !important; overflow: hidden !important; margin: -1px !important; padding: 0 !important; position: absolute !important; width: 1px !important; white-space: nowrap !important; } why not use display: none or opacity:0, or visibility:none
and this code is briliant and i will steal it from you. body { display: grid; place-content: center; background: var(--Main-Background); background: linear-gradient( -45deg, hsl(0, 50%, 1%, 1) 0%, hsl(336, 58%, 14%, 1) 100% ); background-size: 300% 300%; animation: gradient 15s ease infinite; padding: 10px; }
@keyframes gradient { 0% { background-position: 0% 50%; } 50% { background-position: 100% 50%; } 100% { background-position: 0% 50%; } }
0@VCaramesPosted almost 2 years ago@Mirjax2000
- The code is for content that is meant to visually hidden but still accessible to screen readers and currently all those properties are currently the standard. Using
display: none
removes the content entirely. Whileopacity: 0
will hide it visually but you will have to take into consideration the space it takes up and position every single item that is hidden. - Thank you 😄
Marked as helpful0@Mirjax2000Posted almost 2 years ago@vcarames i call it "black hole" technique. you took it sqeeze it to 1px send it out of universe and acces it in different reality.
I rework my first attempt into new version over here, now its much more cleaner and js is simple.
https://www.frontendmentor.io/solutions/interactive-rating-kuZsHOxqjo
0 - The
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