jkellerman / faq-accordion-card-main

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Frontend Mentor - FAQ accordion card solution

This is a solution to the FAQ accordion card challenge on Frontend Mentor. Frontend Mentor challenges help you improve your coding skills by building realistic projects.

Table of contents

Overview

The challenge

Users should be able to:

  • View the optimal layout for the component depending on their device's screen size
  • See hover states for all interactive elements on the page
  • Hide/Show the answer to a question when the question is clicked

Screenshot

Desktop: 1440px Mobile: 375px

Links

My process

Built with

  • Semantic HTML5 markup
  • CSS custom properties
  • Flexbox
  • Mobile-first workflow
  • ES6 JavaScript

Continued development

  • I would like to know how I can make sure that the illustration and the illustration box for desktop version can remain static when the accordion expands and collapses. As the accordion makes the container expand it means the illustrations move with it.
  • Also figuring out how to build an accordion without JS is something I would like to look at in the future.

Useful resources

  • jsfiddle.net - This helped me with the tricky overflow part of this project. It demonstrates how to make one element be hidden by its parent element whilst the other doesn't.

Author

About


Languages

Language:HTML 54.3%Language:CSS 40.8%Language:JavaScript 4.9%