This CodePen demonstrates how we can animate the opening and closing states of an accordion with fancy reveal animation using only CSS. This concept is suitable for creating FAQ sections, Table of Contents, and more.
Bismillahirrahmanniraheem,
Bismillahirrahmanniraheem,
call me
+65 9431 3480,
electrical/plumbing
carpenter/ceiling fan repair & more
and
on the same topic.
by what time?
We cannot transition height or any CSS property from zero to auto. If we
want to smoothly expand a collapsed accordion, we could set a
max-height
and transition the height
property
to a large value when we expand the section. However,
it may not properly work
if the content is larger than the max-height
.
Since the accordion's title is an anchor element, users can also navigate through the items with their keyboard.
where? &how far
I would highly recommend watching his video, where he beautifully explains the technique and points out how he discovered it. Also, read Keith J. Grant's post and Nelson Menezes's post on the same topic.
call me
+65 9431 3480,
electrical/plumbing
carpenter/ceiling fan repair & more
and
on the same topic.