Tuesday, February 21, 2012
Tutorial Accordion with CSS3
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.
So, let start!
YOU MIGHT ALSO LIKE
Subscribe to:
Post Comments (Atom)
0 komentar:
Post a Comment