How to make bootstrap buttons full width on resize only

html, twitter-bootstrap, twitter-bootstrap-3

Solution

You could use a media query to apply the full width buttons at 768 pixels or less..

@media (max-width: 768px) {
    .btn,.btn-group {
        width:100%;
    }
}

Demo: http://bootply.com/98570

Problem

I have a set of 4 inline buttons at the top of my page, under a jumbotron. 2 are dropdowns, the others are just regular buttons. when i resize the browser window, I'd like to make them change to vertical stacked, full width. i know adding the class btn-block will make them full width, but i only want this to happen when the window size is less than 768px. here's my current code. thanks so much! ``` <div class="row"> <div class="btn-group"><button type="button" class="btn btn-default dropdown-toggle" data-toggle="dropdown">Categories <b class="caret"></b></button> <ul class="dropdown-menu"> <li><a href="#">Action</a></li> <li><a href="#">Another action</a></li> <li><a href="#">Something else here</a></li> <li class="divider"></li> <li><a href="#">Separated link</a></li> </ul> </li> </div> <div class="btn-group"><button type="button" class="btn btn-default dropdown-toggle" data-toggle="dropdown">Archives <b class="caret"></b></button> <ul class="dropdown-menu"> <li><a href="#">Action</a></li> <li><a href="#">Another action</a></li> <li><a href="#">Something else here</a></li> <li class="divider"></li> <li><a href="#">Separated link</a></li> </ul> </li> </div> <button class="btn btn-primary"><a href="#"><i class="fa fa-question-circle fa-fw"></i> Info</a> </button> <button class="btn btn-primary"><a href="#"><i class="fa fa-envelope fa-fw"></i> Sign Up</a></button> </div> ```

Original source