It's unclear why the example currently has the content that's
shown/hidden BEFORE the toggle. Generally, this is not a recommended
content order, as after toggling, the newly shown content precedes the
toggle and requires keyboard users, and particularly assistive
technology users, to then navigate in reverse to reach it.
Our collapse plugin allows you to use a `<button>` or `<a>` to toggle hidden content.
{% example html %}
-<div class="collapse" id="exCollapsingNavbar">
- <div class="bg-inverse p-a-1">
- <h4>Collapsed content</h4>
- <span class="text-muted">Toggleable via the navbar brand.</span>
- </div>
-</div>
<nav class="navbar navbar-light bg-faded">
<button class="navbar-toggler" type="button" data-toggle="collapse" data-target="#exCollapsingNavbar" aria-controls="exCollapsingNavbar" aria-expanded="false" aria-label="Toggle navigation">
☰
</button>
+ <div class="collapse" id="exCollapsingNavbar">
+ <div class="bg-inverse p-a-1">
+ <h4>Collapsed content</h4>
+ <span class="text-muted">Toggleable via the navbar brand.</span>
+ </div>
+ </div>
</nav>
{% endexample %}