更新时间:2022-10-21 23:05:06
you have to wrap the button and heading in a div and put class="clearfix-xs"
in it. like this
<div class="clearfix-xs">
<a class="navbar-brand" href="#">Navbar</a>
<button class="navbar-toggler hidden-lg-up float-xs-right" type="button" data-toggle="collapse" data-target="#navbarResponsive" aria-controls="navbarResponsive" aria-expanded="false" aria-label="Toggle navigation">
</button>
</div>
and css for this clss is:
@media(max-width:768px){.clearfix-xs:after {
visibility: hidden;
display: block;
font-size: 0;
content: " ";
clear: both;
height: 0;
}
}
here's a pen