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: Click here
- Live Site URL: Click here
- Semantic HTML5 markup
- CSS custom properties
- Flexbox
- CSS Grid
- Mobile-first workflow
.accordion-content {
font-size: 0.75rem;
max-height: 0;
overflow: hidden;
transition: max-height 0.4s;
}
.accordion input:checked~.accordion-content {
max-height: 100%;
}
.accordion input:checked~label::after {
content: url("images/icon-arrow-down.svg");
height: 100%;
transform: rotate(180deg);
}
I will keep learning these simple trick of css in future and my focus on js.
- Linkedin - @rvamit2648
- Instagram - @Just9krish
- Frontend Mentor - @Just9krish