Bootstrap Collapse Quick Tip

I have been using Twitter Bootstrap for quite sometime. Today I was using Collapse component.  It worked great, but I did not like a couple of things.  In the demo you see on their web site, only one panel can be open at any moment.  If you open the next one, first one will collapse.  You can easily change this behavior by changing the code in the demo on the web site from 




The other minor problem is that the anchor that collapses the panel does not stretch all the way across the panel’s heading.  I found this confusing and non-intuitive.  You can change this just as easily.  Add the following lines to your CSS file.

.panel-title a {     
display: block; }




One Comment

Leave a Reply

Your email address will not be published. Required fields are marked *