Friday, March 1, 2013

Bootstrap accordion collapse to show up collapsed by default

If you are like me, trying to code looking at the view-source or through InspectElement (on chrome) to implement the collapse example on Twitter's bootstrap page - http://twitter.github.com/bootstrap/javascript.html#collapse , you will end up having it not collapse all the div's by default on the page load. 

The culprit is "style="height:auto;" 

Remove the style and all the div's should be collapsed by default, on page load. 

Happy bootstrapping! 

No comments: