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
- Repository URL:repo URL here
- Solution URL: solution URL here
- Live Site URL: live site URL here
- Semantic HTML5 markup
- CSS custom properties(transitions etc.)
- Flexbox
- CSS
- Google Fonts(for fonts)
- Javascript
During this project, I gained a deeper understanding of several CSS properties and JavaScript methods, which significantly enhanced my web development skills. CSS transitions allow HTML elements to gradually change from one style to another. I learned how to apply transitions to different CSS properties and control the speed of the transition.
css
.question::after {
...
transition: transform 0.3s, color 0.3s;
}
The classList.toggle method in JavaScript adds a class to an element if it does not already have it, and removes it if it does. This is particularly useful for interactive elements, like the items in an FAQ accordion.
faqItems[i].addEventListener('click', function () {
this.classList.toggle('active');
});
I think i will focus more on responsivenes and transitions and javascript ,Dom manipulation because i have just started the javascript that's why i dont have good knowledge of js and i am looking forward to know it .
- Example resource 1 - This helped me for css properties . I really liked this documentation and will use it going forward.
- Frontend Mentor - @anuj846k
- Twitter - @anuj846kk
I believe that seeking help and learning from others is an integral part of the development journey. In this project, I sought assistance from Bing AI, which helped me understand and apply the concepts effectively. This not only helped me overcome the challenges I was facing in the project but also contributed to my growth as a developer.