DEV Community

Discussion on: Show and Hide Content Easily With details and summary HTML Tags

Collapse
 
gsarig profile image
Giorgos Sarigiannidis • Edited

This is a nice and simple trick which I wanted to further investigate myself too at some point. Mostly, I wanted to investigate 2 basic topics:

  • Is it semantically correct to use it as an FAQ or should the markup be different on such cases?
  • Can you apply CSS animations?

Do you happen to have any good resources on the above?

Collapse
 
vtrpldn profile image
Vitor Paladini

Hey Giorgos, great questions.

Is it semantically correct to use it as an FAQ or should the markup be different on such cases?

I'd say so, yeah! The says W3C spec says that "The rest of the element’s contents represents the additional information or controls."

A FAQ answer seems like additional information in my book.

Can you apply CSS animations?

Hmm... To a degree, but animating display and height is particularly tricky. I've found some examples but none particularly good. I'll give it a try and update the article if I find a way to do it 🙂