Im having problem while adapting desktop ui to mobile. When i set col-md values from desktop, components resize according to value of col-md but when i add col-sm attribute to these same component there arent any changes in mobile side.
I am using bootstrap 3 by the way
Images will explain better.
CODE
<div id='main' class="container" ng-controller="searchController">
<div class="row" id='tags'>
<div class="col-md-3 col-sm-2" style="display:inline-block">
<h4>Images</h4>
</div>
<div class="col-md-3 col-sm-2" style="display:inline-block">
<h4>Name</h4>
</div>
<div class="col-md-2 col-sm-2" style="display:inline-block">
<h4>Type</h4>
</div>
<div class="col-md-2 col-sm-2" style="display:inline-block">
<h4>Price</h4>
</div>
<div class="col-md-1 col-sm-1" style="display:inline-block">
<h4>Cart</h4>
</div>
<div class="col-md-1 col-sm-1" style="display:inline-block">
<h4>Wishlist</h4>
</div>
</div>
<hr>
<div ng-repeat="result in results" ng-controller="buttonController">
<div class="row">
<div id='image' class="col-md-3 col-sm-3">
<img ng-src="{{result.image}}" style="max-width: 100%;max-height: 100%;">
</div>
<div class="col-md-3 col-sm-1">
<a ng-href='/product/{{result.id}}'>
<h3>{{result.name}}</h3>
</a>
</div>
<div class="col-md-2 col-sm-2" style="display:inline-block">
<h5 style="margin-top:30px">{{result.category}}</h5>
</div>
<div class="col-md-2 col-sm-2">
<h5 style="margin-top:30px">{{result.price}} {{result.currency}}</h5>
</div>
<div class="col-md-1 col-sm-1" style="display:inline-block">
<button ng-click='addBasket(result.id)' type="button" class="btn btn-default btn-sm" style="margin-top:30px">
<span class="glyphicon glyphicon-shopping-cart"></span>
</button>
</div>
<div class="col-md-1 col-sm-1" style="display:inline-block">
<button ng-click='addWishlist(result.id)' type="button" class="btn btn-default btn-sm" style="margin-top:30px">
<span class="glyphicon glyphicon-star"></span>
</button>
</div>
</div>
<div class="col-md-6 alert alert-info ng-cloak" style="float: none; margin: 0 auto;" ng-show="basketAlert">
<strong>Confirm!</strong> This product has been added to your basket.
</div>
<div class="col-md-6 alert alert-info ng-cloak" style="float: none; margin: 0 auto;" ng-show="wishlistAlert">
<strong>Confirm!</strong> This product has been added to your wishlist.
</div>
<div class="col-md-6 alert alert-warning ng-cloak" style="float: none; margin: 0 auto;" ng-show="alreadyInBasketAlert">
<strong>Hey!</strong> This product is already in your basket.
</div>
<div class="col-md-6 alert alert-warning ng-cloak" style="float: none; margin: 0 auto;" ng-show="alreadyInWishlistAlert">
<strong>Hey!</strong> This product is already in your wishlist.
</div>
<hr>
</div>
Im not so good at html pages. Thanks.
From what I'm seeing in the Bootstrap 3 docs, you'll want to use col-xs since your targeting mobile devices ( width < 768px ). The HTML would look like this. I replaced col-sm with col-xs. :
<div id='main' class="container" ng-controller="searchController">
<div class="row" id='tags'>
<div class="col-md-3 col-xs-2" style="display:inline-block">
<h4>Images</h4>
</div>
<div class="col-md-3 col-xs-2" style="display:inline-block">
<h4>Name</h4>
</div>
<div class="col-md-2 col-xs-2" style="display:inline-block">
<h4>Type</h4>
</div>
<div class="col-md-2 col-xs-2" style="display:inline-block">
<h4>Price</h4>
</div>
<div class="col-md-1 col-xs-1" style="display:inline-block">
<h4>Cart</h4>
</div>
<div class="col-md-1 col-xs-1" style="display:inline-block">
<h4>Wishlist</h4>
</div>
</div>
<hr>
<div ng-repeat="result in results" ng-controller="buttonController">
<div class="row">
<div id='image' class="col-md-3 col-xs-3">
<img ng-src="{{result.image}}" style="max-width: 100%;max-height: 100%;">
</div>
<div class="col-md-3 col-xs-1">
<a ng-href='/product/{{result.id}}'>
<h3>{{result.name}}</h3>
</a>
</div>
<div class="col-md-2 col-sm-2" style="display:inline-block">
<h5 style="margin-top:30px">{{result.category}}</h5>
</div>
<div class="col-md-2 col-sm-2">
<h5 style="margin-top:30px">{{result.price}} {{result.currency}}</h5>
</div>
<div class="col-md-1 col-xs-1" style="display:inline-block">
<button ng-click='addBasket(result.id)' type="button" class="btn btn-default btn-sm" style="margin-top:30px">
<span class="glyphicon glyphicon-shopping-cart"></span>
</button>
</div>
<div class="col-md-1 col-xs-1" style="display:inline-block">
<button ng-click='addWishlist(result.id)' type="button" class="btn btn-default btn-sm" style="margin-top:30px">
<span class="glyphicon glyphicon-star"></span>
</button>
</div>
</div>
<div class="col-md-6 alert alert-info ng-cloak" style="float: none; margin: 0 auto;" ng-show="basketAlert">
<strong>Confirm!</strong> This product has been added to your basket.
</div>
<div class="col-md-6 alert alert-info ng-cloak" style="float: none; margin: 0 auto;" ng-show="wishlistAlert">
<strong>Confirm!</strong> This product has been added to your wishlist.
</div>
<div class="col-md-6 alert alert-warning ng-cloak" style="float: none; margin: 0 auto;" ng-show="alreadyInBasketAlert">
<strong>Hey!</strong> This product is already in your basket.
</div>
<div class="col-md-6 alert alert-warning ng-cloak" style="float: none; margin: 0 auto;" ng-show="alreadyInWishlistAlert">
<strong>Hey!</strong> This product is already in your wishlist.
</div>
<hr>
</div>
I have three cols. The middle one contains a decimal number which could be in this formats:
XX.XX km
XXX.XX km
XXXX.XX km
So there could be two to four numbers before the dot and there are always two numbers after the dot.
My problem is if the number is more then two numbers befor the dot the unitary after the decimal number shifts. Then it is not in the alignment with the one under it.
This screenshot shows what I mean.
Is it possible to fix the middle col width so the unitary alignment is correct?
Also the unitary could be align-right?
This is the part of my code:
<link href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css" rel="stylesheet"/>
<div class="col-xs-6">
<div>
<div class="row overall">
<div class="col-sm-12 reducedMarginRight reducedMarginLeft">
<h4 class="font">Overall</h4>
<hr>
</div>
</div>
<div class="row vcenter">
<div class="col-sm-3">
<span class="align-middle">
<i class="glyphicon glyphicon-road glyphSize"></i>
</span>
</div>
<div class="col-sm-5">
<div class="values font align-middle" id="overall_distance">
</div>
</div>
<div class="col-sm-4">
<div class="values font text-right" id="distanceFormat">
km
</div>
</div>
</div>
<div class="row vcenter">
<div class="col-sm-3">
<span>
<i class="glyphicon glyphicon-time glyphSize"></i>
</span>
</div>
<div class="col-sm-5">
<div class="values font" id="overall_time">
</div>
</div>
<div class="col-sm-4">
<div class="values font text-right">
h
</div>
</div>
</div>
</div>
</div>
If I understand your question correctly, Just add text-right class in your value column
<link href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css" rel="stylesheet"/>
<div class="row">
<div class="col-xs-6">
<div class="row overall">
<div class="col-xs-12 reducedMarginRight reducedMarginLeft">
<h4 class="font">Overall</h4>
<hr>
</div>
</div>
<div class="row vcenter">
<div class="col-xs-3">
<span class="align-middle">
<i class="glyphicon glyphicon-road glyphSize"></i>
</span>
</div>
<div class="col-xs-5 text-right">
<div class="values font align-middle" id="overall_distance">690.05
</div>
</div>
<div class="col-xs-4">
<div class="values font text-right" id="distanceFormat">
km
</div>
</div>
</div>
<div class="row vcenter">
<div class="col-xs-3">
<span>
<i class="glyphicon glyphicon-time glyphSize"></i>
</span>
</div>
<div class="col-xs-5 text-right">
<div class="values font" id="overall_time">07:20
</div>
</div>
<div class="col-xs-4">
<div class="values font text-right">
h
</div>
</div>
</div>
</div>
</div>
I'm designing a site using bootstrap 3 and I've been having an issue with aligning portlets. This is what the site currently looks like when the browser is perfectly positioned:
The above picture is a decent example of how I want it to look. I'd like the Dates Portlet to match the combined height of the Purchase Task Details portlet and Purchase Costs portlet. Ideally it would extend to the bottom of the purchase costs portlet. Similarly, I'd like the approvals portlet to match the height and positioning of the Tracking Portlet.
I've tried a number of solutions, but nothing seems to work. Instead, I usually get something that looks like this:
Here's the code I'm using (Please ignore the needs fixing):
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css">
<!-- BEGIN OUTTER COLUMN -->
<div class="col-md-9 sol-sm-9">
<div class="row ">
<!-- START PORTLET -->
<div class="col-md-12 col-sm-12">
<div class="portlet purple-seance box">
<div class="portlet-title">
<div class="caption">
<i class="fa fa-cogs"></i>Purchase Task Details</div>
<div class="actions">
<a href="javascript:;" class="btn btn-default btn-sm">
<i class="fa fa-pencil"></i> Edit</a>
</div>
</div>
<div class="portlet-body">
<div class="row static-info">
<div class="col-md-3 name">Purchase Status:</div>
<div class="col-md-3 value">
<span class="label label-success"> !!! NEEDS FIXIN !!! </span>
</div>
<div class="col-md-3 name">Assigned To:</div>
<div class="col-md-3 value">!!! NEEDS FIXIN !!!</div>
</div>
<div class="row static-info">
<div class="col-md-3 name">Order Type:</div>
<div class="col-md-3 value">!!! NEEDS FIXIN !!!</div>
<div class="col-md-3 name">Order:</div>
<div class="col-md-3 value">!!! NEEDS FIXIN !!!</div>
</div>
<div class="row static-info">
<div class="col-md-3 name">Procurement Ticket</div>
<div class="col-md-3 value">!!! NEEDS FIXIN !!!</div>
<div class="col-md-3 name">Ready Id:</div>
<div class="col-md-3 value">!!! NEEDS FIXIN !!!</div>
</div>
<div class="row static-info">
<div class="col-md-3 name">Vender:</div>
<div class="col-md-3 value">!!! NEEDS FIXIN !!!</div>
<div class="col-md-3 name">Manufacturer:</div>
<div class="col-md-3 value">!!! NEEDS FIXIN !!!</div>
</div>
<div class="row static-info">
<div class="col-md-3 name">Location:</div>
<div class="col-md-3 value">!!! NEEDS FIXIN !!!</div>
<div class="col-md-3 name">PO Number:</div>
<div class="col-md-3 value">!!! NEEDS FIXIN !!!</div>
</div>
<div class="row static-info">
<div class="col-md-3 name">SAP Contract Number:</div>
<div class="col-md-3 value">!!! NEEDS FIXIN !!!</div>
<div class="col-md-3 name">SAP Contract Line Number:</div>
<div class="col-md-3 value">!!! NEEDS FIXIN !!!</div>
</div>
</div>
</div>
<!-- END PORTLET -->
</div>
<!-- END ROW -->
</div>
<div class="row">
<!-- BEGIN INNER COLUMN -->
<div class="cold-md-9">
<!-- START PORTLET -->
<div class="col-md-6 col-sm-6">
<div class="portlet blue-steel box">
<div class="portlet-title">
<div class="caption">
<i class="fa fa-cogs"></i>Deal Structure</div>
<div class="actions">
<a href="javascript:;" class="btn btn-default btn-sm">
<i class="fa fa-pencil"></i> Edit</a>
</div>
</div>
<div class="portlet-body">
<div class="row static-info">
<div class="col-md-5 name">Deal NRR:</div>
<div class="col-md-7 value">!!! NEEDS FIXIN !!!</div>
</div>
<div class="row static-info">
<div class="col-md-5 name">Deal MMR:</div>
<div class="col-md-7 value">!!! NEEDS FIXIN !!!</div>
</div>
<div class="row static-info">
<div class="col-md-5 name">Deal Term:</div>
<div class="col-md-7 value">!!! NEEDS FIXIN !!!
<span class="label label-info label-sm"> ROI </span>
</div>
</div>
<div class="row static-info">
<div class="col-md-5 name">Deal Total:</div>
<div class="col-md-7 value">!!! NEEDS FIXIN !!!
<span class="label label-info label-sm"> $ </span>
</div>
</div>
</div>
</div>
<!-- END PORTLET-->
</div>
<!-- START PORTLET -->
<div class="col-md-6 col-sm-6">
<div class="portlet red-mint box">
<div class="portlet-title">
<div class="caption">
<i class="fa fa-cogs"></i>Purchase Costs</div>
<div class="actions">
<a href="javascript:;" class="btn btn-default btn-sm">
<i class="fa fa-pencil"></i> Edit</a>
</div>
</div>
<div class="portlet-body">
<div class="row static-info">
<div class="col-md-5 name">PR NRC:</div>
<div class="col-md-7 value">!!! NEEDS FIXIN !!!</div>
</div>
<div class="row static-info">
<div class="col-md-5 name">PR MRC:</div>
<div class="col-md-7 value">!!! NEEDS FIXIN !!!</div>
</div>
<div class="row static-info">
<div class="col-md-5 name">Amount:</div>
<div class="col-md-7 value">!!! NEEDS FIXIN !!!</div>
</div>
<div class="row static-info">
<div class="col-md-7">
</br>
</div>
</div>
</div>
</div>
<!-- END PORTLET -->
<!-- END INNER COLUMN -->
</div>
<!-- END ROW -->
</div>
<!-- START PORTLET -->
<div class="col-md-6 col-sm-6">
<div class="portlet green-jungle box">
<div class="portlet-title">
<div class="caption">
<i class="fa fa-cogs"></i>Justification</div>
<div class="actions">
<a href="javascript:;" class="btn btn-default btn-sm">
<i class="fa fa-pencil"></i> Edit</a>
</div>
</div>
<div class="portlet-body" style="display: block;">
<div class="panel-group accordion" id="accordion1">
<div class="panel panel-default">
<div class="panel-heading">
<h4 class="panel-title">
<a class="accordion-toggle collapsed" data-toggle="collapse" data-parent="#accordion1" href="#collapse_1" aria-expanded="false"> Rationale </a>
</h4>
</div>
<div id="collapse_1" class="panel-collapse collapse" aria-expanded="false" style="height: 0px;">
<div class="panel-body">
<p>Example information</p>
</div>
</div>
</div>
<div class="panel panel-default">
<div class="panel-heading">
<h4 class="panel-title">
<a class="accordion-toggle collapsed" data-toggle="collapse" data-parent="#accordion1" href="#collapse_2" aria-expanded="false"> Notes </a>
</h4>
</div>
<div id="collapse_2" class="panel-collapse collapse" aria-expanded="false" style="height: 0px;">
<div class="panel-body" style="height:200px; overflow-y:auto;">
<p>CSCC Quote #14182705</p>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
<!-- START PORTLET -->
<div class="col-md-6 col-sm-6">
<div class="portlet green-jungle box">
<div class="portlet-title">
<div class="caption">
<i class="fa fa-cogs"></i>Tracking</div>
<div class="actions">
<a href="javascript:;" class="btn btn-default btn-sm">
<i class="fa fa-pencil"></i> Edit</a>
</div>
</div>
<div class="portlet-body" style="display: block;">
<div class="panel-group accordion" id="accordion1">
<div class="panel panel-default">
<div class="panel-heading">
<h4 class="panel-title">
<a class="accordion-toggle collapsed" data-toggle="collapse" data-parent="#accordion1" href="#collapse_3" aria-expanded="false"> FedEx </a>
</h4>
</div>
<div id="collapse_3" class="panel-collapse collapse" aria-expanded="false" style="height: 0px;">
<div class="panel-body">
<div class="row static-info">
<div class="col-md-3 name">Tracking:</div>
<div class="col-md-6 value">1111-2222-3333-4444</div>
</div>
<div class="row static-info">
<div class="col-md-3 name">ETA:</div>
<div class="col-md-6 value">Aug, 8, 2016</div>
</div>
</div>
</div>
</div>
<div class="panel panel-default">
<div class="panel-heading">
<h4 class="panel-title">
<a class="accordion-toggle collapsed" data-toggle="collapse" data-parent="#accordion1" href="#collapse_4" aria-expanded="false"> DHL </a>
</h4>
</div>
<div id="collapse_4" class="panel-collapse collapse" aria-expanded="false" style="height: 0px;">
<div class="panel-body" style="height:200px; overflow-y:auto;">
<div class="panel-body">
<div class="row static-info">
<div class="col-md-3 name">Tracking:</div>
<div class="col-md-6 value">1111-2222-3333-4444</div>
</div>
<div class="row static-info">
<div class="col-md-3 name">ETA:</div>
<div class="col-md-6 value">Aug, 8, 2016</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
<!-- END OUTTER COLUMN -->
</div>
<!-- START PORTLET -->
<div class="col-md-3 col-sm-3">
<div class="portlet purple-medium box">
<div class="portlet-title">
<div class="caption">
<i class="fa fa-cogs"></i>Dates</div>
<div class="actions">
<a href="javascript:;" class="btn btn-default btn-sm">
<i class="fa fa-pencil"></i> Edit</a>
</div>
</div>
<div class="portlet-body">
<div class="row static-info">
<div class="col-md-5 name">Purchase Task Created:</div>
<div class="col-md-7 value">!!! NEEDS FIXIN !!!</div>
</div>
<div class="row static-info">
<div class="col-md-5 name">Ticket Received:</div>
<div class="col-md-7 value">!!! NEEDS FIXIN !!!</div>
</div>
<div class="row static-info">
<div class="col-md-5 name">Quote Received:</div>
<div class="col-md-7 value">!!! NEEDS FIXIN !!!</div>
</div>
<div class="row static-info">
<div class="col-md-5 name">PO Issued:</div>
<div class="col-md-7 value">!!! NEEDS FIXIN !!!</div>
</div>
<div class="row static-info">
<div class="col-md-5 name">Change Order Date:</div>
<div class="col-md-7 value">!!! NEEDS FIXIN !!!</div>
</div>
<div class="row static-info">
<div class="col-md-5 name">Order Received Date:</div>
<div class="col-md-7 value">!!! NEEDS FIXIN !!!</div>
</div>
<div class="row static-info">
<div class="col-md-5 name">Lasted Modified:</div>
<div class="col-md-7 value">!!! NEEDS FIXIN !!!</div>
</div>
<div class="row static-info">
<div class="col-md-5 name">Last Modified By:</div>
<div class="col-md-7 value">!!! NEEDS FIXIN !!!</div>
</div>
</div>
</div>
<!-- END PORTLET -->
</div>
<!-- START PORTLET -->
<div class="col-md-3 col-sm-3">
<div class="portlet green-jungle box">
<div class="portlet-title">
<div class="caption">
<i class="fa fa-cogs"></i>Approvals</div>
<div class="actions">
<a href="javascript:;" class="btn btn-default btn-sm">
<i class="fa fa-pencil"></i> Edit</a>
</div>
</div>
<div class="portlet-body">
<div class="row static-info">
<div class="col-md-4 name">Approved by:</div>
<div class="col-md-4 value">!!! NEEDS FIXIN !!!</div>
<div class="col-md-4 value">!!! NEEDS FIXIN !!!</div>
</div>
<div class="row static-info">
<div class="col-md-4 name">Approved by:</div>
<div class="col-md-4 value">!!! NEEDS FIXIN !!!</div>
<div class="col-md-4 value">!!! NEEDS FIXIN !!!</div>
</div>
</div>
</div>
<!-- END PORTLET -->
</div>
<!-- END TAB -->
</div>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.3/jquery.min.js"></script>
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/js/bootstrap.min.js"></script>
I've been wracking my brain over this for a while now. I appreciate any assistance anyone can provide. Thanks!
I am looking for the following grid layout using bootstrap grid system:
[M2][G2][M1][G2][M1][G2][M2]
[M2][T2][M1][T2][M1][T2][M2]
[M2][T2][M1][T2][M1][T2][M2]
Sorry it's quite busy, basically you have a 3 x 3 grid, with a Glyphicon, Title box and then text box going down (there are 3 of these going across). These have margin blocks [M2] either side, representing two blocks and [M1] blocks in between each element. This is generated by the code below, however, after the Glyphicon line, there is a <div class="col-sm-3 margin"></div> which should fill up the whole line, so that I can then start on the next line. This should only take 2 blocks, but I have had to use 3, as otherwise the grid seems to ignore it? This makes the grid overflow to the next row, in which case the Text element is one grid too far, why does a 2 column block followed by another two column block not fill the first line and then indent the next row by two columns? Below is the part od the code showing the first 4 elements + their margin blocks, JSFiddle is a JSFiddle of the full code with working demo of the problem.
<div class="container-fluid PageView text-center">
<div class="row Page2">
<div class="col-sm-2 margin"></div>
<div class="col-sm-2 col-xs-2">
<div class="glyphicon-ring"> <span class="glyphicon glyphicon-bullhorn glyphicon-bordered"></span>
</div>
</div>
<div class="col-sm-1 margin"></div>
<div class="col-sm-2 col-xs-2">
<div class="glyphicon-ring"> <span class="glyphicon glyphicon-ok glyphicon-bordered"></span>
</div>
</div>
<div class="col-sm-1 margin"></div>
<div class="col-sm-2 col-xs-2">
<div class="glyphicon-ring"> <span class="glyphicon glyphicon-phone glyphicon-bordered"></span>
</div>
</div>
<div class="col-sm-3 margin"></div>
<div class="col-sm-2 margin"></div>
<div class="col-sm-2">
<div class="box">
<div class="row">
<div class="col-xs-6 col-sm-12">
<h2><strong>Title 1</strong></h2>
</div>
<div class="col-xs-6 col-sm-1">
<p class="lead">Text 1</p>
</div>
</div>
</div>
</div>
<div class="col-sm-1 margin"></div>
Update
JSFiddle
Added a height to the margin class and also added the missing margin after text 2 (center) block
.margin {
height: 20px;
}
<link href="//maxcdn.bootstrapcdn.com/bootstrap/3.3.2/css/bootstrap.min.css" rel="stylesheet" />
<div class="container-fluid PageView text-center">
<div class="row Page2">
<div class="col-sm-2 margin"></div>
<div class="col-sm-2 col-xs-2">
<div class="glyphicon-ring"> <span class="glyphicon glyphicon-bullhorn glyphicon-bordered"></span>
</div>
</div>
<div class="col-sm-1 margin"></div>
<div class="col-sm-2 col-xs-2">
<div class="glyphicon-ring"> <span class="glyphicon glyphicon-ok glyphicon-bordered"></span>
</div>
</div>
<div class="col-sm-1 margin"></div>
<div class="col-sm-2 col-xs-2">
<div class="glyphicon-ring"> <span class="glyphicon glyphicon-phone glyphicon-bordered"></span>
</div>
</div>
<div class="col-sm-2 margin"></div>
<div class="col-sm-2 margin"></div>
<div class="col-sm-2">
<div class="box">
<div class="row">
<div class="col-xs-6 col-sm-12">
<h2><strong>Title 1</strong></h2>
</div>
<div class="col-xs-6 col-sm-12 eqheight1">
<p class="lead">Text 1</p>
</div>
</div>
</div>
</div>
<div class="col-sm-1 margin"></div>
<div class="col-sm-2">
<div class="box">
<div class="row">
<div class="col-xs-6 col-sm-12">
<h2><strong>Title 2</strong></h2>
</div>
<div class="col-xs-6 col-sm-12 eqheight2">
<p class="lead">Text 2</p>
</div>
</div>
</div>
</div>
<div class="col-sm-1 margin"></div>
<div class="col-sm-2">
<div class="box">
<div class="row">
<div class="col-xs-6 col-sm-12">
<h2><strong>Title 3</strong></h2>
</div>
<div class="col-xs-6 col-sm-12 eqheight3">
<p class="lead">Text 3</p>
</div>
</div>
</div>
</div>
</div>
</div>
I'm currently going through my site testing it at present mobile / desktop is fine, the issue I have is with ipad when viewing the search page on an ipad the tiles are squashed up against the left i.e 1 pic per row, ideally I would like to see two if not three in a row but I cannot get it to work as expected, the HTML mark up for the page is as follows:
<section class="catalog-grid">
<div class="container">
<div class="row">
<div class="col-sm-12">
<div class="filters-mobile col-lg-3 col-md-3 col-sm-5">
<div class="shop-filters" style="display: block;">
<form action="/search/members" method="post">
<div class="widget">
<h5 class="widget-title font-alt">Filter</h5>
</div>
Filter stuff goes here
</form>
</div>
</div>
#*THIS IS WHERE THE RESULTS / PROFILES ARE RENDERED*#
<div class="col-lg-9 col-md-9 col-sm-9">
<div class="row">
<div class="col-lg-4 col-md-4 col-sm-6">
<div class="tile">
<div class="badges">
</div>
<a href='/member/1/new-to-melbourne'>
<img src="http://res.cloudinary.com/dncu6pqpm/image/upload/q_100,c_fill,h_255,w_255,g_face/mhcoeigrttdgemwjuig7" alt="Atkinson1988" />
</a>
<div class="footer">
<a href='/member/1/new-to-melbourne'>Atkinson1988</a>
<span> - <i class="glyphicon glyphicon-map-marker"></i> Victoria, St kilda road<br /></span>
</div>
</div>
</div>
<div class="col-lg-4 col-md-4 col-sm-6">
<div class="tile">
<div class="badges">
</div>
<a href='/member/4/female-2-asian-male-tp'>
<img src="http://res.cloudinary.com/dncu6pqpm/image/upload/q_100,c_fill,h_255,w_255,g_face/t4leodsoxa0h5zaqomt7" alt="Female2" />
</a>
<div class="footer">
<a href='/member/4/female-2-asian-male-tp'>Female2</a>
<span> - <i class="glyphicon glyphicon-map-marker"></i> Victoria, Docklands<br /></span>
</div>
</div>
</div>
<div class="col-lg-4 col-md-4 col-sm-6">
<div class="tile">
<div class="badges">
<span class="best-seller">Online</span>
</div>
<a href='/member/5/hello%2c-is-it-me-your-looking-for'>
<img src="http://res.cloudinary.com/dncu6pqpm/image/upload/q_100,c_fill,h_255,w_255,g_face/j6xnf3lu2gffviv1qkw3" alt="Tester123" />
</a>
<div class="footer">
<a href='/member/5/hello%2c-is-it-me-your-looking-for'>Tester123</a>
<span> - <i class="glyphicon glyphicon-map-marker"></i> Victoria, Melbourne<br /></span>
</div>
</div>
</div>
<div class="col-lg-4 col-md-4 col-sm-6">
<div class="tile">
<div class="badges">
</div>
<a href='/member/2/i-am-a-female-from-melbourne'>
<img src="http://res.cloudinary.com/dncu6pqpm/image/upload/q_100,c_fill,h_255,w_255,g_face/hyssjfqilmyntk9gvi4r" alt="Female1" />
</a>
<div class="footer">
<a href='/member/2/i-am-a-female-from-melbourne'>Female1</a>
<span> - <i class="glyphicon glyphicon-map-marker"></i> Victoria, Melbourne<br /></span>
</div>
</div>
</div>
<div class="col-lg-4 col-md-4 col-sm-6">
<div class="tile">
<div class="badges">
</div>
<a href='/member/3/male-2-lookin-for-male-training-partner'>
<img src="http://res.cloudinary.com/dncu6pqpm/image/upload/c_fill,h_255,w_255,g_face/no-photo_pwpgkz" alt="Male2" />
</a>
<div class="footer">
<a href='/member/3/male-2-lookin-for-male-training-partner'>Male2</a>
<span> - <i class="glyphicon glyphicon-map-marker"></i> Victoria, Southbank<br /></span>
</div>
</div>
</div>
<div class="clearfix"></div>
<div class="row text-center">
<div class="pagination-container"><ul class="pagination"><li class="active"><a>1</a></li></ul></div>
</div>
</div>
</div>
</div>
</div>
</div>
</section>
The above is rendered by doing the following withing MVC Razor view:
<section class="catalog-grid">
<div class="container">
<div class="row">
<div class="col-sm-12">
<div class="filters-mobile col-lg-3 col-md-3 col-sm-4">
<div class="shop-filters" style="display: block;">
#using (Html.BeginForm("Search", "Members", FormMethod.Post))
{
<div class="widget">
<h5 class="widget-title font-alt">My Filter</h5>
</div>
#Html.AntiForgeryToken()
}
</div>
</div>
#*THIS IS WHERE THE RESULTS / PROFILES ARE RENDERED*#
<div class="col-lg-9 col-md-9 col-sm-8 ">
<div class="row">
#if (ViewBag.ListOfUsers.Count > 0)
{
foreach (var t in ViewBag.ListOfUsers)
{
<div class="col-lg-4 col-md-4 col-sm-6">
<div class="tile">
<div class="badges">
#if (t.LoggedIn)
{
<span class="best-seller">Online</span>
}
</div>
<a href='#Url.Action("Member", "User", new { area = "User", Id = t.UserId, slug = t.Headline})'>
#if (!string.IsNullOrWhiteSpace(t.PhotoId))
{
<img src="http://res.cloudinary.com/dncu6pqpm/image/upload/q_100,c_fill,h_255,w_255,g_face/#t.PhotoId" alt="#t.Username" />
}
else
{
<img src="http://res.cloudinary.com/dncu6pqpm/image/upload/c_fill,h_255,w_255,g_face/no-photo_pwpgkz" alt="#t.Username" />
}
</a>
<div class="footer">
<a href='#Url.Action("Member", "User", new { area = "User", Id = t.UserId, slug = t.Headline})'>#t.Username</a>
<span> - <i class="glyphicon glyphicon-map-marker"></i> #t.Location<br /></span>
</div>
</div>
</div>
}
<div class="clearfix"></div>
<div class="row text-center">
#Html.PagedListPager((IPagedList)ViewBag.ListOfUsers, page => Url.Action("Search", "Members", new { page }))
</div>
}
else
{
<div class="col-sm-8 col-sm-offset-2 text-center">
<p>
Sorry, we couldn't find anyone within the criteria you provided.
</p>
</div>
}
</div>
</div>
</div>
</div>
</div>
UPDATE
This is what it currently looks like using the above
My initial guess, without seeing a live demo, is that only one is being shown per row because of col-sm-6. As bootstrap has a 12 column layout if there is any padding or margin applied to the objects 6+6+padding is greater than 12 and will push it to the next row. My understanding is that there should be a "div.row" for each new row. Hope that helps.