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.
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: Solution Frontend Mentor
- Live Site URL: dannvxc FAQ accordion
- Semantic HTML5 markup
- CSS custom properties
- Flexbox
- CSS Grid
- Mobile-first workflow
<details class="accordion">
<summary class="question">
What is the maximum file upload size?
</summary>
<div class="answer">
No more than 2GB. All files in your account must fit your allotted storage space.
</div>
</details>
#images::after{
content: url(/assets/img/illustration-woman-online-mobile.svg);
position: absolute;
width: 73%;
max-width: 19rem;
top: -1rem;
left: 50%;
transform: translate(-50%, -50%);
}
- Developer Mozilla - HTML Elements | - This helped me to make an accordion with a semantic meaning and found the right tag elements for me not to neccesarly use javascript to make it work. I really liked this pattern and will use it going forward.