Skip to content

Pseidu/faq-accordion-card-main

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

12 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Frontend Mentor - FAQ accordion card solution

This is a solution to the FAQ accordion card challenge on Frontend Mentor.

Table of contents

Overview

The challenge

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

./screenshot.jpg

Links

My process

Built with

  • Semantic HTML5 markup
  • CSS custom properties
  • Flexbox
  • Mobile-first workflow

What I learned

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);
}

Author

  • Rafael Soriano
  • Frontend Mentor - [@pseidu]

About

Front End Mentor challenge

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published