I am playing around with Bootstrap and I ran into a small problem that I can't find a solution for. There probably is a solution out there, but I can't, for the life of me, figure out what to search for.
What I want to know is, if there is a way to make the columns snap to each other, so a big gap doesn't show up like shown in the fiddle, below the first div on the left hand side. I hope the fiddle describes the problem well enough for someone to point me in the right direction.
Fiddle: https://jsfiddle.net/DTcHh/24238/
body {
background: tomato;
}
.container {
background: white;
border: 1px solid grey;
}
<link href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css" rel="stylesheet" />
<div class="row">
<div class="col-md-6 container">
<h3>Title</h3>
<p>Paragraph</p>
<div class="media-container">
<a href="http://placehold.it/200x200">
<img src="http://placehold.it/200x200" />
</a>
<a href="http://placehold.it/200x200">
<img src="http://placehold.it/200x200" />
</a>
<a href="http://placehold.it/200x200">
<img src="http://placehold.it/200x200" />
</a>
<a href="http://placehold.it/200x200">
<img src="http://placehold.it/200x200" />
</a>
<a href="http://placehold.it/200x200">
<img src="http://placehold.it/200x200" />
</a>
</div>
</div>
<div class="col-md-6 container">
<h3>Title</h3>
<p>Paragraph</p>
<div class="media-container">
<a href="http://placehold.it/200x200">
<img src="http://placehold.it/200x200" />
</a>
<a href="http://placehold.it/200x200">
<img src="http://placehold.it/200x200" />
</a>
<a href="http://placehold.it/200x200">
<img src="http://placehold.it/200x200" />
</a>
</div>
</div>
<div class="col-md-6 container">
<h3>Title</h3>
<p>Paragraph</p>
<div class="media-container">
<a href="http://placehold.it/200x200">
<img src="http://placehold.it/200x200" />
</a>
<a href="http://placehold.it/200x200">
<img src="http://placehold.it/200x200" />
</a>
<a href="http://placehold.it/200x200">
<img src="http://placehold.it/200x200" />
</a>
</div>
</div>
<div class="col-md-6 container">
<h3>Title</h3>
<p>Paragraph</p>
<div class="media-container">
<a href="http://placehold.it/200x200">
<img src="http://placehold.it/200x200" />
</a>
<a href="http://placehold.it/200x200">
<img src="http://placehold.it/200x200" />
</a>
<a href="http://placehold.it/200x200">
<img src="http://placehold.it/200x200" />
</a>
</div>
</div>
<div class="col-md-6 container">
<h3>Title</h3>
<p>Paragraph</p>
<div class="media-container">
<a href="http://placehold.it/200x200">
<img src="http://placehold.it/200x200" />
</a>
<a href="http://placehold.it/200x200">
<img src="http://placehold.it/200x200" />
</a>
<a href="http://placehold.it/200x200">
<img src="http://placehold.it/200x200" />
</a>
</div>
</div>
<div class="col-md-6 container">
<h3>Title</h3>
<p>Paragraph</p>
<div class="media-container">
<a href="http://placehold.it/200x200" />
<img src="http://placehold.it/200x200" />
</a>
<a href="http://placehold.it/200x200" />
<img src="http://placehold.it/200x200" />
</a>
<a href="http://placehold.it/200x200" />
<img src="http://placehold.it/200x200" />
</a>
</div>
</div>
</div>
Problem in your bootstrap grid structure. You use "container" class under "ROW" & "COL-MD-" so that's why you face the problem.
Working fiddle: https://jsfiddle.net/amitmonsterme/veyq6naL/
view this tutorial : http://getbootstrap.com/css/#overview-container
You can apply the float: right property to particular blocks when the screen width becomes 992px or more. I've defined a new special class .pull-md-right for this purpose.
Please check the result: https://jsfiddle.net/glebkema/9dqsj4pk/
#import url('https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css');
body {
background: tomato;
}
.container {
background: white;
border: 1px solid grey;
}
#media (min-width: 992px) {
.pull-md-right {
float: right !important;
}
}
<div class="container">
<div class="row">
<div class="col-md-6">
<h3>Title 1</h3>
<p>Paragraph</p>
<div class="media-container">
<img src="http://placehold.it/200x200">
<img src="http://placehold.it/200x200">
<img src="http://placehold.it/200x200">
<img src="http://placehold.it/200x200">
<img src="http://placehold.it/200x200">
</div>
</div>
<div class="col-md-6">
<h3>Title 2</h3>
<p>Paragraph</p>
<div class="media-container">
<img src="http://placehold.it/200x200">
<img src="http://placehold.it/200x200">
<img src="http://placehold.it/200x200">
</div>
</div>
<div class="col-md-6 pull-md-right">
<h3>Title 3</h3>
<p>Paragraph</p>
<div class="media-container">
<img src="http://placehold.it/200x200">
<img src="http://placehold.it/200x200">
<img src="http://placehold.it/200x200">
</div>
</div>
<div class="col-md-6">
<h3>Title 4</h3>
<p>Paragraph</p>
<div class="media-container">
<img src="http://placehold.it/200x200">
<img src="http://placehold.it/200x200">
<img src="http://placehold.it/200x200">
</div>
</div>
<div class="col-md-6 pull-md-right">
<h3>Title 5</h3>
<p>Paragraph</p>
<div class="media-container">
<img src="http://placehold.it/200x200">
<img src="http://placehold.it/200x200">
<img src="http://placehold.it/200x200">
</div>
</div>
<div class="col-md-6">
<h3>Title 6</h3>
<p>Paragraph</p>
<div class="media-container">
<img src="http://placehold.it/200x200">
<img src="http://placehold.it/200x200">
<img src="http://placehold.it/200x200">
</div>
</div>
</div>
</div>
Related
How to make a layout on bootstrap4, and then I can not. Thank you in advance!
<div class="col-8">
<a href="#">
<div class="card">
<img class="card-img" src="img.jpg">
</div>
</a>
</div>
<div class="col-4">
<a href="#">
<div class="card">
<img class="card-img" src="img.jpg">
</div>
</a>
</div>
<div class="col-4">
<a href="#">
<div class="card">
<img class="card-img" src="img.jpg">
</div>
</a>
</div>
<div class="col-4">
<a href="#">
<div class="card">
<img class="card-img" src="img.jpg">
</div>
</a>
</div>
<div class="col-4">
<a href="#">
<div class="card">
<img class="card-img" src="img.jpg">
</div>
</a>
</div>
<div class="col-4">
<a href="#">
<div class="card">
<img class="card-img" src="img.jpg">
</div>
</a>
</div>
<div class="col-4">
<a href="#">
<div class="card">
<img class="card-img" src="img.jpg">
</div>
</a>
</div>
<div class="col-4">
<a href="#">
<div class="card">
<img class="card-img" src="img.jpg">
</div>
</a>
</div>
<div class="col-4">
<a href="#">
<div class="card">
<img class="card-img" src="img.jpg">
</div>
</a>
</div>
<div class="col-4">
<a href="#">
<div class="card">
<img class="card-img" src="img.jpg">
</div>
</a>
</div>
Now it goes like this
And need to look like this
Using float: left; styling on the columns will give you this effect.
Below I changed the <img> tag to a <div> with a border to give the same visuals since I don't have img.jpg. If you swap those back in it should still work.
I added the styling to the col classes by just adding:
.col-4, .col-8{
float:left;
}
Though, I would recommend adding a class to the outer div's with this styling instead of pigy-backing on bootstrap's classes.
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>title</title>
<link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.1.2/css/bootstrap.min.css"
integrity="sha384-Smlep5jCw/wG7hdkwQ/Z5nLIefveQRIY9nfy6xoR1uRYBtpZgI6339F5dgvm/e9B" crossorigin="anonymous">
</head>
<body>
<style>
.small-card {
height: 60px;
width: 100%;
border: solid 2px #333;
}
.large-card{
height: 120px;
width: 100%;
border: solid 2px #333;
}
.col-4, .col-8{
float:left;
}
</style>
<div class="col-8">
<a href="#">
<div class="card">
<div class="large-card"></div>
</div>
</a>
</div>
<div class="col-4">
<a href="#">
<div class="card">
<div class="small-card"></div>
</div>
</a>
</div>
<div class="col-4">
<a href="#">
<div class="card">
<div class="small-card"></div>
</div>
</a>
</div>
<div class="col-4">
<a href="#">
<div class="card">
<div class="small-card"></div>
</div>
</a>
</div>
<div class="col-4">
<a href="#">
<div class="card">
<div class="small-card"></div>
</div>
</a>
</div>
<div class="col-4">
<a href="#">
<div class="card">
<div class="small-card"></div>
</div>
</a>
</div>
<div class="col-4">
<a href="#">
<div class="card">
<div class="small-card"></div>
</div>
</a>
</div>
<div class="col-4">
<a href="#">
<div class="card">
<div class="small-card"></div>
</div>
</a>
</div>
<div class="col-4">
<a href="#">
<div class="card">
<div class="small-card"></div>
</div>
</a>
</div>
<div class="col-4">
<a href="#">
<div class="card">
<div class="small-card"></div>
</div>
</a>
</div>
</body>
</html>
I want to align images in center as four in top and and three in bottom which is in same div.
.tiles-menu{
width:1024px;
margin:auto;
}
.tiles-menu .submenu-menu .views-row{
float:left;
}
.tilesImage , .tilesTitle{
margin:auto;
}
.innerPageTilesMenu{
padding:4%;
}
<div id="tiles_menu">
<div class="view view-tiles-menu view-id-tiles_menu view-display-id-block view-dom-id-bdffce08b72061133c0ad959070833a3">
<div class="view-content">
<div class="tiles-menu">
<div class="submenu-menu nav navbar-nav main-menu" style="">
<div class="views-row views-row-1 views-row-odd views-row-first">
<a href="http://localhost/AspireInnerWebsite/services/retail/Consulting&Solutions/Omnichannel">
<div class="innerPageTilesMenu">
<div class="tilesImage">
<img typeof="foaf:Image" src="http://localhost/AspireInnerWebsite/sites/default/files/tab-strategic-store-solutions.jpg" alt="" width="235" height="228">
</div>
<div class="tilesTitle"><p>Omnichannel</p>
</div>
</div>
</a>
</div>
<div class="views-row views-row-2 views-row-even">
<a href="http://localhost/AspireInnerWebsite/services/retail/Consulting&Solutions/Strategic-Store-Solutions">
<div class="innerPageTilesMenu">
<div class="tilesImage">
<img typeof="foaf:Image" src="http://localhost/AspireInnerWebsite/sites/default/files/tab-omnichannel_0.jpg" alt="" width="235" height="228">
</div>
<div class="tilesTitle"><p>Strategic Store Solutions</p>
</div>
</div>
</a>
</div>
<div class="views-row views-row-3 views-row-odd">
<a href="http://localhost/AspireInnerWebsite/services/retail/Consulting&Solutions/Merchandise-Operations">
<div class="innerPageTilesMenu">
<div class="tilesImage">
<img typeof="foaf:Image" src="http://localhost/AspireInnerWebsite/sites/default/files/tab-Merchandise-Operations.jpg" alt="" width="235" height="228"></div>
<div class="tilesTitle"><p>Merchandise Operation</p></div>
</div>
</a>
</div>
<div class="views-row views-row-4 views-row-even">
<a href="http://localhost/AspireInnerWebsite/services/retail/Consulting&Solutions/Retail-Supply-Chain">
<div class="innerPageTilesMenu">
<div class="tilesImage">
<img typeof="foaf:Image" src="http://localhost/AspireInnerWebsite/sites/default/files/tab-Retail-Supply-Chain.jpg" alt="" width="235" height="228"></div>
<div class="tilesTitle"><p>Retail Supply Chain</p></div>
</div>
</a>
</div>
<div class="views-row views-row-5 views-row-odd">
<a href="http://localhost/AspireInnerWebsite/services/retail/Consulting&Solutions/Predictive-Analytics">
<div class="innerPageTilesMenu">
<div class="tilesImage">
<img typeof="foaf:Image" src="http://localhost/AspireInnerWebsite/sites/default/files/tab-Predictive-Analytics.jpg" alt="" width="235" height="228"></div>
<div class="tilesTitle"><p>Predictive Analytics</p></div>
</div>
</a>
</div>
<div class="views-row views-row-6 views-row-even">
<a href="http://localhost/AspireInnerWebsite/services/retail/Consulting&Solutions/Retail-Test-Automation">
<div class="innerPageTilesMenu">
<div class="tilesImage">
<img typeof="foaf:Image" src="http://localhost/AspireInnerWebsite/sites/default/files/tab-Retail-Test-Automation.jpg" alt="" width="235" height="228"></div>
<div class="tilesTitle"><p>Retail Test Automation</p></div>
</div>
</a>
</div>
<div class="views-row views-row-7 views-row-odd views-row-last">
<a href="http://localhost/AspireInnerWebsite/services/retail/Consulting&Solutions/Digital-Services">
<div class="innerPageTilesMenu">
<div class="tilesImage">
<img typeof="foaf:Image" src="http://localhost/AspireInnerWebsite/sites/default/files/tab-digital-services.jpg" alt="" width="235" height="228"></div>
<div class="tilesTitle"><p>Digital Services</p></div>
</div>
</a>
</div>
</div>
</div>
</div>
</div>
</div>
For some purpose I have all the images in single div. I want as shown in star
* * * *
* * *
I have created fiddle Fiddle Demo
You can use css3 flexbox. Consider the following css:
.main-menu {
display: flex;
flex-wrap: wrap;
justify-content: center;
}
.tiles-menu {
width:1024px;
margin:auto;
}
.tiles-menu .submenu-menu .views-row {
float:left;
}
.tilesImage , .tilesTitle{margin:auto;}
.innerPageTilesMenu{padding:4%;}
.main-menu {
display: flex;
flex-wrap: wrap;
justify-content: center;
}
<div id="tiles_menu">
<div class="view view-tiles-menu view-id-tiles_menu view-display-id-block view-dom-id-bdffce08b72061133c0ad959070833a3">
<div class="view-content">
<div class="tiles-menu"><div class="submenu-menu nav navbar-nav main-menu" style=""> <div class="views-row views-row-1 views-row-odd views-row-first">
<a href="http://localhost/AspireInnerWebsite/services/retail/Consulting&Solutions/Omnichannel">
<div class="innerPageTilesMenu">
<div class="tilesImage"><img typeof="foaf:Image" src="http://localhost/AspireInnerWebsite/sites/default/files/tab-strategic-store-solutions.jpg" alt="" width="235" height="228"></div>
<div class="tilesTitle"><p>Omnichannel</p></div>
</div>
</a> </div>
<div class="views-row views-row-2 views-row-even">
<a href="http://localhost/AspireInnerWebsite/services/retail/Consulting&Solutions/Strategic-Store-Solutions">
<div class="innerPageTilesMenu">
<div class="tilesImage"><img typeof="foaf:Image" src="http://localhost/AspireInnerWebsite/sites/default/files/tab-omnichannel_0.jpg" alt="" width="235" height="228"></div>
<div class="tilesTitle"><p>Strategic Store Solutions</p></div>
</div>
</a> </div>
<div class="views-row views-row-3 views-row-odd">
<a href="http://localhost/AspireInnerWebsite/services/retail/Consulting&Solutions/Merchandise-Operations">
<div class="innerPageTilesMenu">
<div class="tilesImage"><img typeof="foaf:Image" src="http://localhost/AspireInnerWebsite/sites/default/files/tab-Merchandise-Operations.jpg" alt="" width="235" height="228"></div>
<div class="tilesTitle"><p>Merchandise Operation</p></div>
</div>
</a> </div>
<div class="views-row views-row-4 views-row-even">
<a href="http://localhost/AspireInnerWebsite/services/retail/Consulting&Solutions/Retail-Supply-Chain">
<div class="innerPageTilesMenu">
<div class="tilesImage"><img typeof="foaf:Image" src="http://localhost/AspireInnerWebsite/sites/default/files/tab-Retail-Supply-Chain.jpg" alt="" width="235" height="228"></div>
<div class="tilesTitle"><p>Retail Supply Chain</p></div>
</div>
</a> </div>
<div class="views-row views-row-5 views-row-odd">
<a href="http://localhost/AspireInnerWebsite/services/retail/Consulting&Solutions/Predictive-Analytics">
<div class="innerPageTilesMenu">
<div class="tilesImage"><img typeof="foaf:Image" src="http://localhost/AspireInnerWebsite/sites/default/files/tab-Predictive-Analytics.jpg" alt="" width="235" height="228"></div>
<div class="tilesTitle"><p>Predictive Analytics</p></div>
</div>
</a> </div>
<div class="views-row views-row-6 views-row-even">
<a href="http://localhost/AspireInnerWebsite/services/retail/Consulting&Solutions/Retail-Test-Automation">
<div class="innerPageTilesMenu">
<div class="tilesImage"><img typeof="foaf:Image" src="http://localhost/AspireInnerWebsite/sites/default/files/tab-Retail-Test-Automation.jpg" alt="" width="235" height="228"></div>
<div class="tilesTitle"><p>Retail Test Automation</p></div>
</div>
</a> </div>
<div class="views-row views-row-7 views-row-odd views-row-last">
<a href="http://localhost/AspireInnerWebsite/services/retail/Consulting&Solutions/Digital-Services">
<div class="innerPageTilesMenu">
<div class="tilesImage"><img typeof="foaf:Image" src="http://localhost/AspireInnerWebsite/sites/default/files/tab-digital-services.jpg" alt="" width="235" height="228"></div>
<div class="tilesTitle"><p>Digital Services</p></div>
</div>
</a> </div>
</div></div>
</div>
</div></div>
Updated your css as. It should fix your issue.
.tiles-menu {
text-align: center;
}
.tiles-menu .submenu-menu .views-row {
//float: left; **remove this code**
display: inline-block;
}
JSFiddle
This question already has answers here:
Bootstrap row with columns of different height
(3 answers)
Closed 6 years ago.
How to fix it?
Please look at this picture and tell me what's wrong.
PS: All the image is 400*250, but the green one is 399*250.I think "img-responsive" class will fix it,but it doesn't work.
<body>
<div class="container">
<div class="row">
<div class="col-md-4">
<a href="" class="thumbnail">
<img class="img-responsive" src="img\1.jpg" alt="">
</a>
</div>
<div class="col-md-4">
<a href="" class="thumbnail">
<img class="img-responsive" src="img\2.jpg" alt="">
</a>
</div>
<div class="col-md-4">
<a href="" class="thumbnail">
<img class="img-responsive" src="img\3.jpg" alt="">
</a>
</div>
<div class="col-md-4">
<a href="" class="thumbnail">
<img class="img-responsive" src="img\4.jpg" alt="">
</a>
</div>
<div class="col-md-4">
<a href="" class="thumbnail">
<img class="img-responsive" src="img\5.jpg" alt="">
</a>
</div>
<div class="col-md-4">
<a href="" class="thumbnail">
<img class="img-responsive" src="img\6.jpg" alt="">
</a>
</div>
<div class="col-md-4">
<a href="" class="thumbnail">
<img class="img-responsive" src="img\7.jpg" alt="">
</a>
</div>
<div class="col-md-4">
<a href="" class="thumbnail">
<img class="img-responsive" src="img\8.jpg" alt="">
</a>
</div>
<div class="col-md-4">
<a href="" class="thumbnail">
<img class="img-responsive" src="img\9.jpg" alt="">
</a>
</div>
</div>
</div>
</body>
</html>
try this, may be this will help you, here i have taken guitar image (400*250) and aeroplane image(399*250) as you mentioned
<!DOCTYPE html>
<html lang="en">
<head>
<title>Bootstrap Example</title>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css">
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.12.4/jquery.min.js"></script>
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/js/bootstrap.min.js"></script>
<style>
#media only screen and (min-width : 980px) {
.img-responsive {
height:250px !important;
}
}
</style>
</head>
<body>
<div class="container">
<div class="row">
<div class="col-md-4">
<a href="" class="thumbnail">
<img class="img-responsive" src="http://2.bp.blogspot.com/-MWgiQDpUc-U/ULjocrm-69I/AAAAAAAAA5g/SOEefmhNo1A/s400/nice+guitar.jpg" alt="">
</a>
</div>
<div class="col-md-4">
<a href="" class="thumbnail">
<img class="img-responsive" src="http://2.bp.blogspot.com/-MWgiQDpUc-U/ULjocrm-69I/AAAAAAAAA5g/SOEefmhNo1A/s400/nice+guitar.jpg" alt="">
</a>
</div>
<div class="col-md-4">
<a href="" class="thumbnail">
<img class="img-responsive" src="http://2.bp.blogspot.com/-MWgiQDpUc-U/ULjocrm-69I/AAAAAAAAA5g/SOEefmhNo1A/s400/nice+guitar.jpg" alt="">
</a>
</div>
<div class="col-md-4">
<a href="" class="thumbnail">
<img class="img-responsive" src="http://2.bp.blogspot.com/-MWgiQDpUc-U/ULjocrm-69I/AAAAAAAAA5g/SOEefmhNo1A/s400/nice+guitar.jpg" alt="">
</a>
</div>
<div class="col-md-4">
<a href="" class="thumbnail">
<img class="img-responsive" src="http://www.pilotstoresusa.com/resize/Shared/images/jcwings/JC4QBA020.jpg?lr=t&bh=250" alt="">
</a>
</div>
<div class="col-md-4">
<a href="" class="thumbnail">
<img class="img-responsive" src="http://2.bp.blogspot.com/-MWgiQDpUc-U/ULjocrm-69I/AAAAAAAAA5g/SOEefmhNo1A/s400/nice+guitar.jpg" alt="">
</a>
</div>
<div class="col-md-4">
<a href="" class="thumbnail">
<img class="img-responsive" src="http://2.bp.blogspot.com/-MWgiQDpUc-U/ULjocrm-69I/AAAAAAAAA5g/SOEefmhNo1A/s400/nice+guitar.jpg" alt="">
</a>
</div>
<div class="col-md-4">
<a href="" class="thumbnail">
<img class="img-responsive" src="http://2.bp.blogspot.com/-MWgiQDpUc-U/ULjocrm-69I/AAAAAAAAA5g/SOEefmhNo1A/s400/nice+guitar.jpg" alt="">
</a>
</div>
<div class="col-md-4">
<a href="" class="thumbnail">
<img class="img-responsive" src="http://2.bp.blogspot.com/-MWgiQDpUc-U/ULjocrm-69I/AAAAAAAAA5g/SOEefmhNo1A/s400/nice+guitar.jpg" alt="">
</a>
</div>
</div>
</div>
</body>
</html>
I'm sure this is obvious but I can't figure it out. I want to create a grid of images like so:
[Image] [Image] | [ Big
[Image] [Image] | Image ]
I can do this fine with just images but the problem is that the images are nested inside links. So I'm trying to figure out how to make the links float left.
My HTML is:
<div class="row">
<div class="col-md-6">
<a href="img/1-1full.png" title="" data-gallery>
<img src="img/1-1.png" alt="">
</a>
<a href="img/1-2full.png" title="" data-gallery>
<img src="img/1-2.png" alt="">
</a>
<a href="img/1-3full.png" title="" data-gallery>
<img src="img/1-3.png" alt="">
</a>
<a href="img/1-4full.png" title="" data-gallery>
<img src="img/1-4.png" alt="">
</a>
</div>
<div class="col-md-6">
<a href="img/1-largefull.png" title="" data-gallery>
<img src="img/1-large.png" alt="">
</a>
</div>
</div>
<div style="clear: both;">
My CSS is:
.gallery .col-md-6 a {
float: left;
display: block;
}
.gallery .col-md-6 a:nth-child(odd) {
width: 307px;
margin: 0 30px 30px 0;
}
.gallery .col-md-6 a:nth-child(even) {
width: 278px;
margin: 0;
}
The width of each col-md-6 is 585 px so they should fit together. .gallery is getting targeted correctly too, it's showing up in the code inspector. There's obviously something basic about floats that I'm not understanding.
If you're already using a grid framework (Bootstrap), why not take advantage of it. It's a little extra markup, but I think it achieves what you are looking for.
<div class="row">
<div class="col-md-6">
<div class="row">
<div class="col-md-6">
<a href="img/1-1full.png" title="" data-gallery>
<img src="img/1-1.png" alt="" class="img-responsive">
</a>
</div>
<div class="col-md-6">
<a href="img/1-2full.png" title="" data-gallery>
<img src="img/1-2.png" alt="" class="img-responsive">
</a>
</div>
</div>
<div class="row">
<div class="col-md-6">
<a href="img/1-3full.png" title="" data-gallery>
<img src="img/1-3.png" alt="" class="img-responsive">
</a>
</div>
<div class="col-md-6">
<a href="img/1-4full.png" title="" data-gallery>
<img src="img/1-4.png" alt="" class="img-responsive">
</a>
</div>
</div>
</div>
<div class="col-md-6">
<a href="img/1-largefull.png" title="" data-gallery>
<img src="img/1-large.png" alt="" class="img-responsive">
</a>
</div>
</div>
Would this work for you? I have given two examples, seeing your layout. One with 4 a row and the other with 2 a row.
* {box-sizing: border-box;}
.half {width: 50%;}
.quat {width: 25%;}
.sz34 {width: 75%;}
.cols {float: left;}
img {width: 100%; height: 65px; display: block; border: 1px solid #ccc;}
.parent {overflow: hidden;}
.parent div {float: left;}
img.double-height {height: 130px;}
<div class="parent">
<div class="half">
<div class="quat"><img src="" alt="Image"></div>
<div class="quat"><img src="" alt="Image"></div>
<div class="quat"><img src="" alt="Image"></div>
<div class="quat"><img src="" alt="Image"></div>
<div class="quat"><img src="" alt="Image"></div>
<div class="quat"><img src="" alt="Image"></div>
<div class="quat"><img src="" alt="Image"></div>
<div class="quat"><img src="" alt="Image"></div>
</div>
<div class="half">
<img src="" alt="Image" class="double-height">
</div>
</div>
<hr />
<div class="parent">
<div class="half">
<div class="half"><img src="" alt="Image"></div>
<div class="half"><img src="" alt="Image"></div>
<div class="half"><img src="" alt="Image"></div>
<div class="half"><img src="" alt="Image"></div>
</div>
<div class="half">
<img src="" alt="Image" class="double-height">
</div>
</div>
I have a image gallery which is not straighting/fullfilling the full width in a row
html
<div class="col-md-6">
<figure class="gallery">
<img src="images/blog_1.png" alt="img">
<img src="images/blog_1.png" alt="img">
<img src="images/blog_1.png" alt="img">
<img src="images/blog_1.png" alt="img">
<img src="images/blog_1.png" alt="img">
<img src="images/blog_1.png" alt="img">
</figure>
</div>
css
.gallery{
display:table;
}
.gallery img{
display: inline-block;
padding: 2px;
background: transparent;
}
display:table-cell is also not working . There is 6 images here
.gallery{
display:table;
white-space: nowrap;
}
.gallery img{
display: inline-block;
padding: 2px;
background: transparent;
}
<div class="col-md-6">
<figure class="gallery">
<img src="http://placehold.it/100x100" alt="img" />
<img src="http://placehold.it/100x100" alt="img" />
<img src="http://placehold.it/100x100" alt="img" />
<img src="http://placehold.it/100x100" alt="img" />
<img src="http://placehold.it/100x100" alt="img" />
<img src="http://placehold.it/100x100" alt="img" />
</figure>
</div>
From what I understood (since you have not mentioned the image size.)
.gallery{
}
.gallery > div{
padding:2px;
}
.gallery img{
background: transparent;
width:100%;
}
<script src="//maxcdn.bootstrapcdn.com/bootstrap/3.3.4/js/bootstrap.min.js"></script>
<link href="//maxcdn.bootstrapcdn.com/bootstrap/3.3.4/css/bootstrap.min.css" rel="stylesheet"/>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.1/jquery.min.js"></script>
<div class="col-md-12">
<div class="gallery row">
<div class="col-xs-2">
<img src="http://www.jpl.nasa.gov/spaceimages/images/mediumsize/PIA17011_ip.jpg" alt="img"/>
</div>
<div class="col-xs-2">
<img src="http://www.jpl.nasa.gov/spaceimages/images/mediumsize/PIA17011_ip.jpg" alt="img"/>
</div>
<div class="col-xs-2">
<img src="http://www.jpl.nasa.gov/spaceimages/images/mediumsize/PIA17011_ip.jpg" alt="img"/>
</div>
<div class="col-xs-2">
<img src="http://www.jpl.nasa.gov/spaceimages/images/mediumsize/PIA17011_ip.jpg" alt="img"/>
</div>
<div class="col-xs-2">
<img src="http://www.jpl.nasa.gov/spaceimages/images/mediumsize/PIA17011_ip.jpg" alt="img"/>
</div>
<div class="col-xs-2">
<img src="http://www.jpl.nasa.gov/spaceimages/images/mediumsize/PIA17011_ip.jpg" alt="img"/>
</div>
</div>
</div>
Add Below css
.gallery{
display:table;
margin:0;
}
DEMO