Home / Menu & Accordion / Accordion with css3

Accordion with css3

Download Demo
  • Overview
  • Documents
User Rating: 3.6/5 ( 1 votes)
Your Rating:

Today we’ll experiment some more with the adjacent and general sibling combinator and the :checked pseudo-class. Using hidden inputs and labels, we will create an accordion that will animate the content areas on opening and closing.

There are many variations of CSS-only accordions around, most of which are implemented using the target pseudo-class. The problem with using target is that we can’t really close the content areas again or have multiple sections open at the same time. By using hidden checkboxes, we can control the opening and closing. Alternatively, we can also use radio buttons if only one section should be open at a time.

Scroll To Top