Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found

Submitted

Mobile first approach using html,css,js

Fatimaā€¢ 145

@FatimahFarooq

Desktop design screenshot for the FAQ accordion card coding challenge

This is a solution for...

  • HTML
  • CSS
  • JS
1newbie
View challenge

Design comparison


SolutionDesign

Solution retrospective


Any feedback is appreciated :)

Community feedback

P
Daveā€¢ 5,255

@dwhenson

Posted

Hey @FatimahFarooq nice job on this one! šŸ™Œ the site looks great and responds nicely. Here's some suggestions you might like to think about:

  1. I prefer to avoid JS where possible. One thing that really helped me with this one was the use of the details and summary HTML elements. These have much of the functionality baked in and can be styled with a little bit CSS work.

  2. This would also have the advantage of including keyboard functionality and allow the key elements to be focusable automatically. This is missing at present so I can only use my mouse to open the elements (not ideal for accessibility).

  3. If you went with this approach you can also animate the opening and closing pretty simply using some code like:

details[open] summary ~ * {
	animation: sweep 0.2s ease-out;
	will-change: opacity, transform;
}

@keyframes sweep {
	0% {
		opacity: 0;
		transform: translateY(-1em);
	}

	100% {
		opacity: 1;
		transform: translateY(0);
	}
}

You also have some issues with the positioning of that pesky box image in desktop view, and you may want to have a think about how to position components overall within the viewports.

This last point is most important, I generally put a three column grid on the body and position the children elements in the center column. It's useful to get an approach that works for you as it's needed for all challenges. Let me know if you need more info on that.

But, all that aside, you've done a great job here, and positioning all those images is not easy! Nice one šŸ‘

Marked as helpful

3

Please log in to post a comment

Log in with GitHub
Discord logo

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