I think this may need to be done using JS. It's quite simple to do using Jquery:
'div' can be any CSS selector. This piece of code will either collapse or open the element with a smooth animation dependent on whether it is visible or not, such as having display: none applied in your CSS. This is most useful with an event handler like 'click'.
For example, you could have a button which calls toggleSlide on the collapsable element whenever it's clicked with a few lines of code: