I'm coding a project listing page in bootstrap and I'm stuck with an issue.I have a sidebar with a fixed height where I list the checkboxes and I have a main container beside the sidebar which lists the product. By default the area under the sidebar is empty. default style
Is there anyway I can list the products under the sidebar as shown in this
I want to show lists under sidebar and all the items should be in a single row
/* Latest compiled and minified CSS included as External Resource*/
/* Optional theme */
#import url('//stackpath.bootstrapcdn.com/bootstrap/4.1.1/css/bootstrap.min.css');
aside {
background: #ddd;
}
.row {
align-items: flex-start;
}
.col-sm-4 {
padding-bottom: 25px;
}
img{
max-width: 100%;
}
ul {
list-style: none;
padding-left: 5px;
}
<div class="container">
<div class="row">
<aside class="col-sm-3">
<ul>
<li>Checkbox</li>
<li>Checkbox</li>
<li>Checkbox</li>
<li>Checkbox</li>
<li>Checkbox</li>
<li>Checkbox</li>
</ul>
</aside>
<main class="col-sm-9">
<div class="row">
<div class="col-sm-4">
<img src="http://via.placeholder.com/150x150">
</div>
<div class="col-sm-4">
<img src="http://via.placeholder.com/150x150">
</div>
<div class="col-sm-4">
<img src="http://via.placeholder.com/150x150">
</div>
<div class="col-sm-4">
<img src="http://via.placeholder.com/150x150">
</div>
<div class="col-sm-4">
<img src="http://via.placeholder.com/150x150">
</div>
<div class="col-sm-4">
<img src="http://via.placeholder.com/150x150">
</div>
<div class="col-sm-4">
<img src="http://via.placeholder.com/150x150">
</div>
<div class="col-sm-4">
<img src="http://via.placeholder.com/150x150">
</div>
<div class="col-sm-4">
<img src="http://via.placeholder.com/150x150">
</div>
</div>
</main>
</div>
</div>
see code below (here is fiddle:https://jsfiddle.net/7q9hkrcb/)
#import url('//stackpath.bootstrapcdn.com/bootstrap/4.1.1/css/bootstrap.min.css');
aside {
background: #ddd;
}
body{
margin-top:20px
}
.row {
align-items: flex-start;
}
.col-sm-6 {
padding-bottom: 25px;
}
.col-sm-4 {
padding-bottom: 25px;
}
img{
max-width: 100%;
}
ul {
list-style: none;
padding-left: 5px;
}
<div class="container">
<div class="row">
<aside class="col-sm-4">
<ul>
<li>Checkbox</li>
<li>Checkbox</li>
<li>Checkbox</li>
<li>Checkbox</li>
<li>Checkbox</li>
<li>Checkbox</li>
<li>Checkbox</li>
<li>Checkbox</li>
<li>Checkbox</li>
<li>Checkbox</li>
</ul>
</aside>
<div class="col-sm-8">
<div class="row">
<div class="col-sm-6">
<img src="http://via.placeholder.com/150x150">
</div>
<div class="col-sm-6">
<img src="http://via.placeholder.com/150x150">
</div>
<div class="col-sm-6">
<img src="http://via.placeholder.com/150x150">
</div>
<div class="col-sm-6">
<img src="http://via.placeholder.com/150x150">
</div>
</div>
</div>
<div class="col-sm-12">
<div class="row">
<div class="col-sm-4">
<img src="http://via.placeholder.com/150x150">
</div>
<div class="col-sm-4">
<img src="http://via.placeholder.com/150x150">
</div>
<div class="col-sm-4">
<img src="http://via.placeholder.com/150x150">
</div>
<div class="col-sm-4">
<img src="http://via.placeholder.com/150x150">
</div>
</div>
</div>
</div>
</div>
Related
I have a <section> tag in which there are 3 images. How can I center them for fullscreens?
The size of my screen is 22.9 ".
here is the code:
<section class="gallery">
<div class="container-fluid">
<div class="row">
<div class="fw mix-container home-gallery">
<div class="mix landscape portrait">
<div class="item-img">
<img src="images/parfum-aux-agrumes-002.jpg""/>
</div>
</div>
<div class="mix landscape portrait">
<div class="item-img">
<img src="images/parfum-aux-agrumes-003.jpg""/>
</div>
</div>
<div class="mix landscape portrait">
<div class="item-img">
<img src="images/parfum-aux-agrumes-004.jpg""/>
</div>
</div>
</div>
</div>
</div>
Thank you for your answers
Best regards.
I have included a code snippet below that will run.
Essentially you make the images inline-block so they sit next to each other.
Then you can set the images parent container to be left 50%, and offset it with transform:translate();
You can change the width of the images as needed but the same logic should still apply.
.mix {
width: 200px;
height: 100px;
border: black solid 1px;
display: inline-block;
}
.mix-container {
position: relative;
display: inline-block;
left: 50%;
transform: translate(-50%, 0);
}
<section class="gallery">
<div class="container-fluid">
<div class="row">
<div class="fw mix-container home-gallery">
<div class="mix landscape portrait">
<div class="item-img">
<img src="images/parfum-aux-agrumes-002.jpg"/>
</div>
</div>
<div class="mix landscape portrait">
<div class="item-img">
<img src="images/parfum-aux-agrumes-003.jpg"/>
</div>
</div>
<div class="mix landscape portrait">
<div class="item-img">
<img src="images/parfum-aux-agrumes-004.jpg"/>
</div>
</div>
</div>
</div>
</div>
</section>
I have problem in vertical space between Up and down portfolio row.
I have some unwanted space in rows
It's not margin or padding in box, i think this problem is for img tag
Can anyone help me?
.portfolio.row {
display: flex;
}
.col-4 {
flex: 33.33%;
}
.portfolio > div img {
width: 100%;
}
<div class="portfolio row">
<div class="col-4" id="coffe">
<img src="https://cdn.pixabay.com/photo/2019/05/07/16/19/strawberry-4186310_960_720.jpg" alt="Nature1">
</div>
<div class="col-4" id="coffe">
<img src="https://cdn.pixabay.com/photo/2019/05/07/16/19/strawberry-4186310_960_720.jpg" alt="Nature2">
</div>
<div class="col-4" id="coffe">
<img src="https://cdn.pixabay.com/photo/2019/05/07/16/19/strawberry-4186310_960_720.jpg" alt="Nature3">
</div>
</div>
<div class="portfolio row">
<div class="col-4" id="work">
<img src="https://cdn.pixabay.com/photo/2019/05/07/16/19/strawberry-4186310_960_720.jpg" alt="Nature1">
</div>
<div class="col-4" id="work">
<img src="https://cdn.pixabay.com/photo/2019/05/07/16/19/strawberry-4186310_960_720.jpg" alt="Nature2">
</div>
<div class="col-4" id="work">
<img src="https://cdn.pixabay.com/photo/2019/05/07/16/19/strawberry-4186310_960_720.jpg" alt="Nature3">
</div>
</div>
My guess is that it's trying to keep the aspect ratio of the images. If you add height: 100% it does work:
.portfolio.row {
display: flex;
}
.col-4 {
flex: 33.33%;
}
.portfolio > div img {
width: 100%;
height: 100%;
}
<div class="portfolio row">
<div class="col-4" id="coffe">
<img src="https://cdn.pixabay.com/photo/2019/05/07/16/19/strawberry-4186310_960_720.jpg" alt="Nature1">
</div>
<div class="col-4" id="coffe">
<img src="https://cdn.pixabay.com/photo/2019/05/07/16/19/strawberry-4186310_960_720.jpg" alt="Nature2">
</div>
<div class="col-4" id="coffe">
<img src="https://cdn.pixabay.com/photo/2019/05/07/16/19/strawberry-4186310_960_720.jpg" alt="Nature3">
</div>
</div>
<div class="portfolio row">
<div class="col-4" id="work">
<img src="https://cdn.pixabay.com/photo/2019/05/07/16/19/strawberry-4186310_960_720.jpg" alt="Nature1">
</div>
<div class="col-4" id="work">
<img src="https://cdn.pixabay.com/photo/2019/05/07/16/19/strawberry-4186310_960_720.jpg" alt="Nature2">
</div>
<div class="col-4" id="work">
<img src="https://cdn.pixabay.com/photo/2019/05/07/16/19/strawberry-4186310_960_720.jpg" alt="Nature3">
</div>
</div>
Just use the following code and it will be fixed! height: 100%; will solve your problem. here is example
.portfolio>div img {
width: 100%;
height: 100%; /* Add this extar value */
}
I have a layout like this:
body {
text-align: center;
}
.link {
position: relative;
}
.info {
display: flex;
flex-direction: column;
justify-content: center;
align-items: center;
position: absolute;
top: 0;
text-align: center;
width: 100%;
height: 100%;
background-color: #263238;
color: #1DE9B6;
opacity: 0;
visibility: hidden;
}
.link:hover .info {
opacity: 1;
visibility: visible;
}
.col-md-3 {
margin-bottom: 30px;
}
<div class="container">
<div class="row">
<div class="col-md-3">
<div class="link">
<img class="img-fluid" src="http://image.tmdb.org/t/p/w300/c9XxwwhPHdaImA2f1WEfEsbhaFB.jpg" alt="img">
<div class="info">Info</div>
</div>
</div>
<div class="col-md-3">
<div class="link">
<img class="img-fluid" src="http://image.tmdb.org/t/p/w300/c9XxwwhPHdaImA2f1WEfEsbhaFB.jpg" alt="img">
<div class="info">Info</div>
</div>
</div>
<div class="col-md-3">
<div class="link">
<img class="img-fluid" src="http://image.tmdb.org/t/p/w300/c9XxwwhPHdaImA2f1WEfEsbhaFB.jpg" alt="img">
<div class="info">Info</div>
</div>
</div>
<div class="col-md-3">
<div class="link">
<img class="img-fluid" src="http://image.tmdb.org/t/p/w300/c9XxwwhPHdaImA2f1WEfEsbhaFB.jpg" alt="img">
<div class="info">Info</div>
</div>
</div>
<div class="col-md-3">
<div class="link">
<img class="img-fluid" src="http://image.tmdb.org/t/p/w300/c9XxwwhPHdaImA2f1WEfEsbhaFB.jpg" alt="img">
<div class="info">Info</div>
</div>
</div>
<div class="col-md-3">
<div class="link">
<img class="img-fluid" src="http://image.tmdb.org/t/p/w300/c9XxwwhPHdaImA2f1WEfEsbhaFB.jpg" alt="img">
<div class="info">Info</div>
</div>
</div>
<div class="col-md-3">
<div class="link">
<img class="img-fluid" src="http://image.tmdb.org/t/p/w300/c9XxwwhPHdaImA2f1WEfEsbhaFB.jpg" alt="img">
<div class="info">Info</div>
</div>
</div>
<div class="col-md-3">
<div class="link">
<img class="img-fluid" src="http://image.tmdb.org/t/p/w300/c9XxwwhPHdaImA2f1WEfEsbhaFB.jpg" alt="img">
<div class="info">Info</div>
</div>
</div>
</div>
</div>
When the layout gets small, and only one column is displayed horizontally, the div which is supposed to show on hover gets as big as the column, but I only want it to be as big as the fluid image. How would I need to achieve this?
Here is the codepen link: https://codepen.io/Kestvir/pen/gKVwLe
Just add display: inline-block to the link element
.link {
position: relative;
display: inline-block;
}
Or you can also add d-inline-block position-relative classes on the .link elements .
body {
text-align: center;
}
.link {
position: relative;
display: inline-block;
}
.info {
display: flex;
flex-direction: column;
justify-content: center;
align-items: center;
position: absolute;
top: 0;
text-align: center;
width: 100%;
height: 100%;
background-color: #263238;
color: #1DE9B6;
opacity: 0;
visibility: hidden;
}
.link:hover .info {
opacity: 1;
visibility: visible;
}
.col-md-3 {
margin-bottom: 30px;
}
<link href="https://cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap/4.1.1/css/bootstrap.css" rel="stylesheet"/>
<div class="container">
<div class="row">
<div class="col-md-3">
<div class="link">
<img class="img-fluid" src="http://image.tmdb.org/t/p/w300/c9XxwwhPHdaImA2f1WEfEsbhaFB.jpg" alt="img">
<div class="info">Info</div>
</div>
</div>
<div class="col-md-3">
<div class="link">
<img class="img-fluid" src="http://image.tmdb.org/t/p/w300/c9XxwwhPHdaImA2f1WEfEsbhaFB.jpg" alt="img">
<div class="info">Info</div>
</div>
</div>
<div class="col-md-3">
<div class="link">
<img class="img-fluid" src="http://image.tmdb.org/t/p/w300/c9XxwwhPHdaImA2f1WEfEsbhaFB.jpg" alt="img">
<div class="info">Info</div>
</div>
</div>
<div class="col-md-3">
<div class="link">
<img class="img-fluid" src="http://image.tmdb.org/t/p/w300/c9XxwwhPHdaImA2f1WEfEsbhaFB.jpg" alt="img">
<div class="info">Info</div>
</div>
</div>
<div class="col-md-3">
<div class="link">
<img class="img-fluid" src="http://image.tmdb.org/t/p/w300/c9XxwwhPHdaImA2f1WEfEsbhaFB.jpg" alt="img">
<div class="info">Info</div>
</div>
</div>
<div class="col-md-3">
<div class="link">
<img class="img-fluid" src="http://image.tmdb.org/t/p/w300/c9XxwwhPHdaImA2f1WEfEsbhaFB.jpg" alt="img">
<div class="info">Info</div>
</div>
</div>
<div class="col-md-3">
<div class="link">
<img class="img-fluid" src="http://image.tmdb.org/t/p/w300/c9XxwwhPHdaImA2f1WEfEsbhaFB.jpg" alt="img">
<div class="info">Info</div>
</div>
</div>
<div class="col-md-3">
<div class="link">
<img class="img-fluid" src="http://image.tmdb.org/t/p/w300/c9XxwwhPHdaImA2f1WEfEsbhaFB.jpg" alt="img">
<div class="info">Info</div>
</div>
</div>
</div>
</div>
i was using bootstrap grid system to format picture like:
this is my code :
<div class="row">
<div class="col-md-4">
<div class="well"><img src="..." class="img-responsive"">
<br/>
<br/>
<br/>
<br/>
<br/>
</div>
</div>
<div class="col-md-8">
<div class="row">
<div class="col-md-6">
<div class="well"><img src="..." class="img-responsive" alt="Responsive image"></div>
</div>
</div>
<div class="row">
<div class="col-md-6">
<div class="well"><img src="..." class="img-responsive" alt="Responsive image"></div>
</div>
</div>
</div>
</div>
I want the picture to be responsive so I put class="img-responsive" on the <img>
<img src="..." class="img-responsive" alt="Responsive image">
but end up like the right picture. if i dont use class="img-responsive" the image will show on full resulution. how i fix this? (please give me a easy explanation because i'm a noob :) )
You can apply CSS Flexbox rules on .row & .col-*-*. I've used some custom classes (all the .col-*-* has a class called .item). Like:
.row {
display: flex;
}
.item {
display: flex;
flex-direction: column;
}
.item.left {
flex-direction: row;
}
Have a look at the snippet below:
.row {
display: flex;
}
.item {
display: flex;
flex-direction: column;
}
.item.left {
flex-direction: row;
}
.item.left .well {
width: 100%;
align-self: stretch;
}
.item.left .well img {
height: 100%;
}
<link href="https://cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap/3.3.7/css/bootstrap.min.css" rel="stylesheet"/>
<div class="row">
<div class="item left col-sm-4">
<div class="well"><img src="http://placehold.it/200x200" class="img-responsive">
</div>
</div>
<div class="item col-sm-8">
<div class="row">
<div class="col-sm-6">
<div class="well"><img src="http://placehold.it/100x100" class="img-responsive" alt="Responsive image"></div>
</div>
</div>
<div class="row">
<div class="col-sm-6">
<div class="well"><img src="http://placehold.it/100x100" class="img-responsive" alt="Responsive image"></div>
</div>
</div>
</div>
</div>
Hope this helps!
You should use following HTML structure as you need left and right columns having equal width:
<div class="container">
<div class="row">
<div class="col-xs-6">
// content....
</div>
<div class="col-xs-6">
// content....
</div>
</div>
</div>
<link href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css" rel="stylesheet"/>
<div class="container">
<div class="row">
<div class="col-xs-6">
<div class="well"><img src="..." class="img-responsive">
<br>
<br>
<br>
<br><br>
</div>
</div>
<div class="col-xs-6">
<div class="well"><img src="..." class="img-responsive" alt="Responsive image"></div>
<div class="well"><img src="..." class="img-responsive" alt="Responsive image"></div>
</div>
</div>
</div>
I am getting my head around bootstrap 3 , html5 and css3. Trying to build a page containing a few images:
.front {
margin: 3px;
padding: 3px;
}
img {
height: 300px;
}
<div class="form-group">
<div class="col-lg-3">
<div class="front">
<img src="https://encrypted-tbn2.gstatic.com/images?q=tbn:ANd9GcRE1_PJ6L1IQVa2v6Xd1G7vypRQbQmCKGTq0TkMNJmMHFPm-hvKYA" alt="messi" />
</div>
</div>
<div class="col-lg-3">
<div>
<img src="https://encrypted-tbn2.gstatic.com/images?q=tbn:ANd9GcRE1_PJ6L1IQVa2v6Xd1G7vypRQbQmCKGTq0TkMNJmMHFPm-hvKYA" alt="messi" />
</div>
</div>
<div class="col-lg-3">
<div>
<img src="https://encrypted-tbn2.gstatic.com/images?q=tbn:ANd9GcRE1_PJ6L1IQVa2v6Xd1G7vypRQbQmCKGTq0TkMNJmMHFPm-hvKYA" alt="messi" />
</div>
</div>
<div class="col-lg-3">
<div>
<img src="https://encrypted-tbn2.gstatic.com/images?q=tbn:ANd9GcRE1_PJ6L1IQVa2v6Xd1G7vypRQbQmCKGTq0TkMNJmMHFPm-hvKYA" alt="messi" />
</div>
</div>
<div class="col-lg-3">
<div>
<img src="https://encrypted-tbn2.gstatic.com/images?q=tbn:ANd9GcRE1_PJ6L1IQVa2v6Xd1G7vypRQbQmCKGTq0TkMNJmMHFPm-hvKYA" alt="messi" />
</div>
</div>
<div class="col-lg-3">
<div>
<img src="https://encrypted-tbn2.gstatic.com/images?q=tbn:ANd9GcRE1_PJ6L1IQVa2v6Xd1G7vypRQbQmCKGTq0TkMNJmMHFPm-hvKYA" alt="messi" />
</div>
</div>
<div class="col-lg-3">
<div>
<img src="https://encrypted-tbn2.gstatic.com/images?q=tbn:ANd9GcRE1_PJ6L1IQVa2v6Xd1G7vypRQbQmCKGTq0TkMNJmMHFPm-hvKYA" alt="messi" />
</div>
</div>
<div class="col-lg-3">
<div>
<img src="https://encrypted-tbn2.gstatic.com/images?q=tbn:ANd9GcRE1_PJ6L1IQVa2v6Xd1G7vypRQbQmCKGTq0TkMNJmMHFPm-hvKYA" alt="messi" />
</div>
</div>
</div>
Question: how can I display the images adding some space (margin, padding) between them? I tried to set the margin/padding for the img css rule:
here is a link to the code:https://github.com/dimster2013/soccerapp/commit/f9bde7aafbcffffabc9b034b66ee25440ea5f6aa
Add Below CSS
.col-sm-3 .front img {
padding: 10px 5px 5px 10px !important;
width:100%!important;
}
.col-sm-3{
padding:0px!important;
}
<div class="form-group">
<div class="col-lg-3 col-sm-3">
<div class="front">
<img src="https://encrypted-tbn2.gstatic.com/images?q=tbn:ANd9GcRE1_PJ6L1IQVa2v6Xd1G7vypRQbQmCKGTq0TkMNJmMHFPm-hvKYA" alt="messi">
</div>
</div>
<div class="col-lg-3 col-sm-3">
<div class="front">
<img src="https://encrypted-tbn2.gstatic.com/images?q=tbn:ANd9GcRE1_PJ6L1IQVa2v6Xd1G7vypRQbQmCKGTq0TkMNJmMHFPm-hvKYA" alt="messi">
</div>
</div>
<div class="col-lg-3 col-sm-3">
<div class="front">
<img src="https://encrypted-tbn2.gstatic.com/images?q=tbn:ANd9GcRE1_PJ6L1IQVa2v6Xd1G7vypRQbQmCKGTq0TkMNJmMHFPm-hvKYA" alt="messi">
</div>
</div>
<div class="col-lg-3 col-sm-3">
<div class="front">
<img src="https://encrypted-tbn2.gstatic.com/images?q=tbn:ANd9GcRE1_PJ6L1IQVa2v6Xd1G7vypRQbQmCKGTq0TkMNJmMHFPm-hvKYA" alt="messi">
</div>
</div>
<div class="col-lg-3 col-sm-3">
<div class="front">
<img src="https://encrypted-tbn2.gstatic.com/images?q=tbn:ANd9GcRE1_PJ6L1IQVa2v6Xd1G7vypRQbQmCKGTq0TkMNJmMHFPm-hvKYA" alt="messi">
</div>
</div>
<div class="col-lg-3 col-sm-3">
<div class="front">
<img src="https://encrypted-tbn2.gstatic.com/images?q=tbn:ANd9GcRE1_PJ6L1IQVa2v6Xd1G7vypRQbQmCKGTq0TkMNJmMHFPm-hvKYA" alt="messi">
</div>
</div>
<div class="col-lg-3 col-sm-3">
<div class="front">
<img src="https://encrypted-tbn2.gstatic.com/images?q=tbn:ANd9GcRE1_PJ6L1IQVa2v6Xd1G7vypRQbQmCKGTq0TkMNJmMHFPm-hvKYA" alt="messi">
</div>
</div>
<div class="col-lg-3 col-sm-3">
<div class="front">
<img src="https://encrypted-tbn2.gstatic.com/images?q=tbn:ANd9GcRE1_PJ6L1IQVa2v6Xd1G7vypRQbQmCKGTq0TkMNJmMHFPm-hvKYA" alt="messi">
</div>
</div>
</div>
If you have a look at your markup, you are using div elements with class col-lg-3 in which house your img tags.
By placing:
.col-lg-3 {
display: inline-block;
margin: 3px;
padding: 3px;
}
on this div class instead, it should work for you.
The reason your images are displaying one per line is due to div elements being display: block declaration by default. Overriding this by setting inline-block would allow multiple images per line (if screen width permits).
A quick demo would be:
img {
height: 300px;
}
.col-lg-3 {
display: inline-block;
margin: 3px;
padding: 3px;
}
<div class="form-group">
<div class="col-lg-3">
<div class="front">
<img src="https://encrypted-tbn2.gstatic.com/images?q=tbn:ANd9GcRE1_PJ6L1IQVa2v6Xd1G7vypRQbQmCKGTq0TkMNJmMHFPm-hvKYA" alt="messi" />
</div>
</div>
<div class="col-lg-3">
<div>
<img src="https://encrypted-tbn2.gstatic.com/images?q=tbn:ANd9GcRE1_PJ6L1IQVa2v6Xd1G7vypRQbQmCKGTq0TkMNJmMHFPm-hvKYA" alt="messi" />
</div>
</div>
<div class="col-lg-3">
<div>
<img src="https://encrypted-tbn2.gstatic.com/images?q=tbn:ANd9GcRE1_PJ6L1IQVa2v6Xd1G7vypRQbQmCKGTq0TkMNJmMHFPm-hvKYA" alt="messi" />
</div>
</div>
<div class="col-lg-3">
<div>
<img src="https://encrypted-tbn2.gstatic.com/images?q=tbn:ANd9GcRE1_PJ6L1IQVa2v6Xd1G7vypRQbQmCKGTq0TkMNJmMHFPm-hvKYA" alt="messi" />
</div>
</div>
<div class="col-lg-3">
<div>
<img src="https://encrypted-tbn2.gstatic.com/images?q=tbn:ANd9GcRE1_PJ6L1IQVa2v6Xd1G7vypRQbQmCKGTq0TkMNJmMHFPm-hvKYA" alt="messi" />
</div>
</div>
<div class="col-lg-3">
<div>
<img src="https://encrypted-tbn2.gstatic.com/images?q=tbn:ANd9GcRE1_PJ6L1IQVa2v6Xd1G7vypRQbQmCKGTq0TkMNJmMHFPm-hvKYA" alt="messi" />
</div>
</div>
<div class="col-lg-3">
<div>
<img src="https://encrypted-tbn2.gstatic.com/images?q=tbn:ANd9GcRE1_PJ6L1IQVa2v6Xd1G7vypRQbQmCKGTq0TkMNJmMHFPm-hvKYA" alt="messi" />
</div>
</div>
<div class="col-lg-3">
<div>
<img src="https://encrypted-tbn2.gstatic.com/images?q=tbn:ANd9GcRE1_PJ6L1IQVa2v6Xd1G7vypRQbQmCKGTq0TkMNJmMHFPm-hvKYA" alt="messi" />
</div>
</div>
</div>
One way is to add a margin to div (col-lg-3) containing the images - this rule could look similar to this:
.col-lg-3 {
margin-bottom: 40px;
}
That will add space between the images as you asked for. It will still display all images underneath each other, not on the same line; other answers to your question explain why.