This is a solution to the FAQ accordion challenge on Frontend Mentor. Frontend Mentor challenges help you improve your coding skills by building realistic projects.
Users should be able to:
- Hide/Show the answer to a question when the question is clicked
- Navigate the questions and hide/show answers using keyboard navigation alone
- View the optimal layout for the interface depending on their device's screen size
- See hover and focus states for all interactive elements on the page
- Solution URL: https://github.com/ajay117/faq-accordion-main
- Live Site URL: https://ajay117.github.io/faq-accordion-main/
- Semantic HTML5 markup
- CSS custom properties
- Flexbox
- Mobile-first workflow
- Website - https://github.com/ajay117
- Frontend Mentor - @ajay117
- Twitter - @AjayInTech
Acknowledgment to ChatGPT for the following CSS code snippet
/*
The following CSS snippet allows using the summary element as a flexbox
for both text and SVG without cluttering it with additional child elements.
*/
.summary::before {
content: attr(data-text); /* Use the data-text attribute as content */
flex-grow: 1; /* Allow text to grow and take up available space */
font-size: 16px; /* Adjust font size as needed */
}