Mobile-first responsive, pixel-perfect w/ HTML & CSS & JS
Design comparison
Solution retrospective
Hello 👋
What i have done
- Built an accessible switch using radio buttons
- Overridden focus effect on inputs, buttons
- Used my own judgement to achieve pixel-perfect without design files
- Utilize clamp() and min() for better responsiveness
Any feedback would be appreciated 🙏
Community feedback
- @krushnasinnarkarPosted 4 months ago
Hi @haquanq,
Congratulations on successfully completing the challenge!
I have a suggestion regarding your code that I believe will be of great interest to you.
I noticed you tried to work with top and bottom background SVGs but hid them when they didn't work. I'd like to help you fix that.
Here are the steps to resolve the issue:
-
Move the
background-color
property from the.main__container
class to thebody
element:body { background-color: #yourBackgroundColor; }
-
Remove the
display: none
property from the.main__bg-pattern--top
and.main__bg-pattern--bottom
classes, and reduce theirz-index
to-1
:.main__bg-pattern--top, .main__bg-pattern--bottom { display: block; /* or remove this line if display: none is not present */ z-index: -1; }
The issue was that the background images were not visible when we tried to reduce the
z-index
because thebackground-color
was applied to the.main__container
and the images were sent behind the.main__container
. By moving thebackground-color
to thebody
, the background images are now visible above background color and can be positioned behind the content.I hope you find this helpful, and I would greatly appreciate it if you could mark my comment as helpful if it was.
Feel free to reach out if you have more questions or need further assistance.
Happy coding!
Marked as helpful0@haquanqPosted 4 months ago@krushnasinnarkar Thanks for your tips
This submission was a rework of an old submission, i forgot to put the background pattern on 😆😆
0 -
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