css - How to make horizontal list of bootstrap 3 panels responsive? -
i'm using bootstrap 3 , struggling make horizontal list of panels responsive. html below. renders fine in browsers on mobile resolution text not responsive. ideas missing?
<body> <div class="container"> <div class="row"> <div class="col-xs-2"> <div class="panel panel-primary"> <div class="panel-heading"> <h3 class="panel-title">sprinkler system <br />test & inspection</h3> </div> <div class="panel-body"> lorem ipsum dolor sit amet, qui ne iudicabit honestatis. cu utroque adversarium usu, ius ut autem consulatu. </div> </div> </div> <div class="col-xs-2"> <div class="panel panel-primary"> <div class="panel-heading"> <h3 class="panel-title">heading panel</h3> </div> <div class="panel-body"> lorem ipsum dolor sit amet, qui ne iudicabit honestatis. cu utroque adversarium usu, ius ut autem consulatu. </div> </div> </div> <div class="col-xs-2"> <div class="panel panel-primary"> <div class="panel-heading"> <h3 class="panel-title">heading panel</h3> </div> <div class="panel-body"> lorem ipsum dolor sit amet, qui ne iudicabit honestatis. cu utroque adversarium usu, ius ut autem consulatu. </div> </div> </div> <div class="col-xs-2"> <div class="panel panel-primary"> <div class="panel-heading"> <h3 class="panel-title">heading panel</h3> </div> <div class="panel-body"> lorem ipsum dolor sit amet, qui ne iudicabit honestatis. cu utroque adversarium usu, ius ut autem consulatu. </div> </div> </div> </div> </div> </body>
to make mobile friendly should have different column sizes @ lower resolution. words long fit within col-xs-2. keep 4 columns layout giving 2 classes of col-xs-6 , col-sm-3. once gets smaller resolution columns re arranged appropriately.
your divs contain panels should have class changed in each of them. give 2 column layout @ xs resolution , 4 column layout @ small , above
<div class="col-xs-6 col-sm-3"> </div>
if have issues panels not aligning on lower resolution when rearranged might fix issue: bootstrap fluid row columns different height
you have add css class
.col-xs-6:nth-child(odd) { clear: both; }
Comments
Post a Comment