Design comparison
Solution retrospective
This is my solution to the FAQ Accordion Card challenge. I used JavaScript to help with maintaining the position of the @ box, though I'm wondering if there are any better ways of ensuring it keeps its position when the desktop screen is resized. Any feedback on this would be very appreciated!
Community feedback
- @pikapikamartPosted over 3 years ago
Hey, good work on this. Though I had problem inspecting your layout. When not inspecting, your layout is good in desktop the mobile state is good as well.
Suggestions:
- Do not use
height: 100%
on thebody
tag. Since you are using 100% of the parent's height, which in this case, the viewport itself. So you are limiting the body's height. Try inspecting your layout from the bottom, you will see that you content is somehow cut off. Hover on yourbody
element and you will see that the size of it is only half, because it is only limited to the remaining viewport's height. Please refrain from using any sizes from the viewport. Instead you can remove this, but the problem is that, it will have no dimension, because you set the whole accordion container,absolute
which removes itself from the flow.
1.1. Instead of
position: absolute
just make itstatic
for the position. This way, it is back to the normal flow, remove thetop
property. But doing this, you will need to addpadding
to the top and bottom of thebody
tag, to prevent the accordion touching the ceiling and flooring. Maybepadding: 8rem 0
, I tried it and works well, the box is aligned on it.- This is very important, adding breakpoints. Resizing your layout cuts off the left and right side of the container which is not really ideal, causing scrollbar at the bottom.
2.2. What you can do is that, in your
container
selector. Remove themin-width: 1000px
and addwidth: 100%
so that it scales when resizing from the sides. But still, the content inside it needs to be responsive on the size as well. I will leave that for you.-
On your mobile state, It will be awesome if you tweak the breakpoint at around 400px, since phone nowadays have higher ppi than 375px, so if they have higher than that, they cannot see the mobile view.
-
Adding
cursor: pointer
on the accordion questions.
But still, good work on this and if you need help about those, just drop it here okay^
0@cwus619Posted over 3 years ago@pikamart Hey, sorry, I've only just seen your comment this evening! Thanks a lot for the feedback, really appreciate it :)
0 - Do not use
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