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

FAQ accordion card with React and Styled components

#react#styled-components
P
Marina 820

@MarinaDur

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


This is my final project. It got really complicated trying to make it responsive with the 3 images, it looked really bad so I changed it for big screens. I couldn't figure out how to make the questions to open smoothly with transition. Also couldn't figure out how to make the images to cut off at the adge on big screen. z-index didn't help, in dev tools it said that the z-index cannot apply because of position:static, but I didn't have position:static anywhere. Any ssuggestions and help will be really appriciated. Thank you

Community feedback

Wendy 1,670

@wendyhamel

Posted

Hi Marina, Good job taking on this challange! You are right, making this one responsive is complicated.

The smooth transitions for the answers is a problem. You can't transition dynamic height (height:auto), it needs absolute values. You can tinker around with it, but I often end up with it still beeing a bit janky. The position: static is the default position for all elements, if you don't specify a position yourself. To make this work in this challange you will need to work with position:relative and position: absolute. The element (a div for example) containing the image should have position:relative for the image with position:absolute to work. In this challange you will need two different locations for the two different images to show properly on different screen sizes.

If you like to improve some more, you could work on the accessibility. If you use more semantic HTML elements, your solutions will be better accessible for screen readers and by keyboard. A <ul> with <li> items for example to show the questions and you could use the <details> element for the separate questions.

Good places to learn:

mozilla

css tricks

I do not want to reveal too much about how you could do this, it helps to figure out your own approach. But if you get stuck, Keep asking questions and don't give up!

0

P
Marina 820

@MarinaDur

Posted

@wendyhamel Hi Wendy, Thank you so much for the answer. I will check those resources out!

0

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