what is data-toggle=”collapse”


what is data-toggle=”collapse”,collapsing  .collapse.in in HTML, .collapse.in ,where we can use this, what is the differece between them?

venkat Train Asked on April 14, 2015 in Programmer.
Add Comment
1 Answer(s)

For hiding the drop down , we use this collapse option, see the example below
ex: for anchor tag

<a class="btn btn-primary" data-toggle="collapse" href="#collapseExample" aria-expanded="false" aria-controls="collapseExample">
  Link with href
</a>
for button
<button class="btn btn-primary" type="button" data-toggle="collapse" data-target="#collapseExample" aria-expanded="false" aria-controls="collapseExample">
  Button with data-target
</button>
and my div is

<div class="collapse" id="collapseExample">
  .....
</div>

in the same manner:

  • .collapse hides content
  • .collapsing is applied during transitions
  • .collapse.in shows content


venkat Train Answered on April 17, 2015.
Add Comment

Your Answer

By posting your answer, you agree to the privacy policy and terms of service.