This is a solution to the FAQ accordion card challenge on Frontend Mentor.
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.jpg
- Solution URL: https://github.com/Pseidu/faq-accordion-card-main.git
- Live Site URL: https://pseidu.github.io/faq-accordion-card-main/
- Semantic HTML5 markup
- CSS custom properties
- Flexbox
- Mobile-first workflow
HTML: I used details and picture elements for the first time CSS: An element positioned absolute references first ancestor positioned.
Styling details element:
details[open] summary {
font-weight: bold;
}
details[open] p {
height: auto;
margin-top: 15px;
}
details[open] img {
/*-webkit-transform:rotate(180deg);
-moz-transform: rotate(180deg);
-ms-transform: rotate(180deg);
-o-transform: rotate(180deg);*/
transform: rotate(180deg);
}
- Rafael Soriano
- Frontend Mentor - [@pseidu]