Responsive Faq accordion secion made with CSS grid and CSS flexbox
Design comparison
Solution retrospective
Hello Frontendmentors. I am back with a new design that I tried my hands on. I am currently Learning JavaScript so I tried myJavaScript skills on this design and it was successful . I also added a CSS animation to the dropdown any suggestion about that also?
#1. I found it difficult positioning Images as to how the design looks. Working with Images Is complicated.
#2.I am unsure about the media breakpoints between mobile and desktop which is the Tablet. Please anybody? what do you think about the breakpoints. or what do you suggest.
#3. Is it a best practice to set a min-height for a flex or grid container?
Community feedback
- @pikapikamartPosted over 2 years ago
Hey, nice work on this one. For desktop layout, I think it looks fine, just needed for the proper
font-weight
to be used and also the svg's outline is overflowing, on the original, the outline should be cut. The mobile state looks fine as well.On your questions:
- Yep, working with images sometimes is hard specially when you need to
position: absolute
something but I think that you did great on this one! - For the breakpoints, it depends sometimes on the design of the project that you are creating, sometimes it doesn't need to use breakpoints especially when you created the component really responsive. For me, when I use breakpoint, I typically go with
768px
for the tablet and1000px
on desktop state, I always start now with mobile first approach. Sometimes this changes because like I said, it depends on the layout. - You can if you want and there's nothing wrong with that. I use that when there is only a single component of the page and I want the whole
body
to occupy the full height.
Here are some other suggestions for the site:
- When including images on your site that acts only as decorative images, you should always use an empty value for the
alt
attribute and adding an extraaria-hidden="true"
attribute on theimg
would be nice. On this one, the lady illustration should be using those attributes I mentioned since it is only decorative. - Just a remined, only use descriptive
alt
values for images that are really meaningful on the site and when adding the text, the text should not include words that relates to graphic such asillustration, image, icon
since theimg
tag is already a graphic and no need to describe it as one. - Change those FAQ question from using
h2
into usingbutton
or maybe just use adetails
element on this one. When creating applications or websites, if a component is interactive, always use interactive elements likebutton
. I saw that you are using thediv
as a toggle for the content which should not be the case. - Those arrow-images should be hidden as well since it is only a decorative image. Use the above method I mentioned to hide it.
- For each question's answer, those are only being hidden visually by the
overflow
andmax-height
but a user can still traverse those. If you need to hide an element, adding thevisibility: hidden
should be done andvisibility: visible
if it needs to be shown.
Aside from those, great job again on this one. Let me know if you need any help.
0@Kamasah-DicksonPosted over 2 years ago@pikapikamart I have really learn alot from you today Thanks alot. This was very helpful, also I will look much into details about the arla-hidden property. Thanks for your opinion :}
1 - Yep, working with images sometimes is hard specially when you need to
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