html - Unable to images in collapsed columns on a mobile device - bootstrap -
question background:
i have webpage features column 4 images. each column set @ col-lg-3
, col-sm-12
respectively. implementing media queries resize images when site used on mobile devices.
the issue:
the images evenly space when viewed on pc or on mobile device when held horizontally when viewed on device in portrait style images no centering in divs.
this page when viewed on pc or on device horizontally:
this when viewed on device held in portrait fashion:
code:
this html markup images:
<div class="productlogo"> <div class="container"> <div class="row"> <div class="col-lg-3 col-sm-12 text-center" style="padding-top:5px; padding-bottom:5px; width:25%;"><img class="img-responsive" src="~/images/camaroweb.png" /></div> <div class="col-lg-3 col-sm-12 text-center" style="padding-top:15px; padding-bottom:15px; width:25%;"><img class="img-responsive" src="~/images/axminster.png" /></div> <div class="col-lg-3 col-sm-12 text-center" style="padding-top:15px; padding-bottom:15px; width:25%;"><img class="img-responsive" src="~/images/gerflor.png" /></div> <div class="col-lg-3 col-sm-12 text-center" style="padding-top:15px; padding-bottom:15px; width:25%;"><img class="img-responsive" src="~/images/altro.png" /></div> </div> </div> </div>
productlogo class:
.productlogo { background-color: #335cad; padding-top: 20px; padding-bottom: 20px; width:100%; }
if can advise me on how images center in divs on mobile device great
try switching col
classes build mobile-first perspective.
<div class="productlogo"> <div class="container"> <div class="row"> <div class="col-sm-12 col-lg-3 text-center" style="padding-top:5px; padding-bottom:5px; width:25%;"><img class="img-responsive" src="~/images/camaroweb.png" /></div> <div class="col-sm-12 col-lg-3 text-center" style="padding-top:15px; padding-bottom:15px; width:25%;"><img class="img-responsive" src="~/images/axminster.png" /></div> <div class="col-sm-12 col-lg-3 text-center" style="padding-top:15px; padding-bottom:15px; width:25%;"><img class="img-responsive" src="~/images/gerflor.png" /></div> <div class="col-sm-12 col-lg-3 text-center" style="padding-top:15px; padding-bottom:15px; width:25%;"><img class="img-responsive" src="~/images/altro.png" /></div> </div> </div> </div>
Comments
Post a Comment