Earlier this year I was asked if it was possible to replicate an ordered list that could be opened and closed that worked down to IE8…
Ultimately the requirements changed and it was never used, however, due to my lack of finding a solution when initially searching I thought it worthwhile to publish the solution:
Ideally CSS would have the construct to do this with lists but unfortunately, it does not.
In the example, I have used
<div>‘s for each item. You could replace these with
<li>‘s and use a list, but that has implications from semantic and accessibility perspectives. If you do choose to use a list you will need to add: