How to make a Bootstrap accordion collapse when clicking the header div?

I am using yii\bootstrap\Collapse.

In a bootstrap collapse, instead of requiring a click on the a text, I want to make it collapse when clicking anywhere in the panel-heading div.

When can I change it?

That kind of customization is not directly supported by yii\bootstrap\Collapse.

Basically it’s only a thin wrapper over Bootstrap’s Collapse plugin.

You will have to do some extra javascript coding in order to do what you want.

Please refer to the documentation of Bootstrap.

This is not yii problem, you need to change bootstrap styles. Try add to your css:


padding: 0;


.panel-heading .panel-title .collapse-toggle{

display: block;

padding: 10px;