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.
This is to practice positioning elements by CSS and semantic HTML. All interactive elements are focusable. I used
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
- Solution URL: Frontend Mentor
- Live Site URL: Vercel
- Semantic HTML5 markup
- CSS custom properties
- Flexbox
- CSS Grid
- Mobile-first workflow
It was first time using
I spent a quite long time to positioning the images of woman and the background especially for desktop view. To hide the part of base structure in woman's illustration, I used
overflow: hidden;
On the desktop view, I wanted to vertically center the card (white card) by using CSS grid, however the text inside the accordion can change the width when it's expanded. In the future, I would like to improve more on positioning illustrations.
- MDN - : The Details disclosure element - This helped me to understand how to customise the defaul style and effects.
- MDN - CSS selectors
- Frontend Mentor - @sloth247