The forums ran from 2008-2020 and are now closed and viewable here as an archive.

Home Forums CSS help with id for CSS and HTML for pure CSS Accordion

  • This topic is empty.
Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
  • #292405

    The attached code works above, without issue.

    However, the page that I often want to use requires multiple accordion items, which as it stands requires me to edit the HTML code and change the id value incrementally for every accordion.

    I was wondering if there is a change in the code I can do so all accordions do not require an ID and the styles are propagated for all versions/copies of the accordion code in the HTML.

    Hopefully, that makes sense.


    While I’m not seeing the JS required for this, you’d just need to change from IDs to classes, just something unique you can name them.

    Personally I like the Bootstrap approach.

Viewing 2 posts - 1 through 2 (of 2 total)
  • The forum ‘CSS’ is closed to new topics and replies.