Expected behavior
Images should scale down/up and stay in the same line
Actual behavior
I created a row of images which should scale down on smaller devices, but they instead break into a new line.
I'm using Bootstrap 4.
Code
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0/css/bootstrap.min.css" integrity="sha384-Gn5384xqQ1aoWXA+058RXPxPg6fy4IWvTNh0E263XmFcJlSAwiGgFAW/dAiS6JXm" crossorigin="anonymous">
<!-- src omitted -->
<div style="margin:auto; display:table;">
<img class="img-fluid" />
<img class="img-fluid" />
<img class="img-fluid" />
<img class="img-fluid" />
<img class="img-fluid" />
<img class="img-fluid" />
</div>
<script src="https://code.jquery.com/jquery-3.2.1.slim.min.js" integrity="sha384-KJ3o2DKtIkvYIK3UENzmM7KCkRr/rE9/Qpg6aAZGJwFDMVNA/GpGFF93hXpG5KkN" crossorigin="anonymous"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/popper.js/1.12.9/umd/popper.min.js" integrity="sha384-ApNbgh9B+Y1QKtv3Rn7W3mgPxhU9K/ScQsAP7hUibX39j7fakFPskvXusvfa0b4Q" crossorigin="anonymous"></script>
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0/js/bootstrap.min.js" integrity="sha384-JZR6Spejh4U02d8jOt6vLEHfe/JQGiRRSQQxSfFWpi1MquVdAyjUar5+76PVCmYl" crossorigin="anonymous"></script>
Use flexbox and keep the default nowrap
.img-fluid {
min-width: 0;
}
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0/css/bootstrap.min.css">
<div class="d-flex justify-content-center">
<img class="img-fluid" src="https://picsum.photos/200/200?image=1069">
<img class="img-fluid" src="https://picsum.photos/200/200?image=1065">
<img class="img-fluid" src="https://picsum.photos/200/200?image=1063">
<img class="img-fluid" src="https://picsum.photos/200/200?image=1062">
<img class="img-fluid" src="https://picsum.photos/200/200?image=1063">
<img class="img-fluid" src="https://picsum.photos/200/200?image=1062">
</div>
And to scale on both direction you can add another container for the images:
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0/css/bootstrap.min.css">
<div class="d-flex justify-content-center">
<div><img class="img-fluid" src="https://picsum.photos/200/200?image=1069"></div>
<div><img class="img-fluid" src="https://picsum.photos/200/200?image=1065"></div>
<div><img class="img-fluid" src="https://picsum.photos/200/200?image=1063"></div>
<div><img class="img-fluid" src="https://picsum.photos/200/200?image=1062"></div>
<div><img class="img-fluid" src="https://picsum.photos/200/200?image=1063"></div>
<div><img class="img-fluid" src="https://picsum.photos/200/200?image=1062"></div>
</div>
You can use the built-in row and col class from bootstrap4 to achieve that.
Demo: http://jsfiddle.net/aq9Laaew/81140/
<div class="container">
<div class="row">
<div class="col">
<img class="img-fluid" />
</div>
...
</div>
</div>
You can also style them using flexbox.
Note: Make sure you use align-items: flex-start; or align-items: center; on the parent element, as align-items: stretch; is the default hence images will look horrible, like the accepted answer.
Updates:
The writer of the accepted answer said there is no difference when setting align-items: flex-start;. Here is the proof to show there is indeed: http://jsfiddle.net/aq9Laaew/81196/
The images without setting the align-items will default to stretch and they're stretched so much that I couldn't even capture them in the screenshot.
But yea the stretch effect might be what OP wants hence that's accepted answer.
Related
I have a square grid. I would like to make the size of the pictures smaller by specifying measurement, while retaining the 2x2 shape, or 3x3 shape etc. Tried setting the width property but did not work. Currently its too big.
How would I resolve this?
<link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.3.1/css/bootstrap.min.css" integrity="sha384-ggOyR0iXCbMQv3Xipma34MD+dH/1fQ784/j6cY/iJTQUOhcWr7x9JvoRxT2MZw1T" crossorigin="anonymous">
<script src="https://code.jquery.com/jquery-3.3.1.slim.min.js" integrity="sha384-q8i/X+965DzO0rT7abK41JStQIAqVgRVzpbzo5smXKp4YfRvH+8abtTE1Pi6jizo" crossorigin="anonymous"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/popper.js/1.14.7/umd/popper.min.js" integrity="sha384-UO2eT0CpHqdSJQ6hJty5KVphtPhzWj9WO1clHTMGa3JDZwrnQq4sF86dIHNDz0W1" crossorigin="anonymous"></script>
<script src="https://stackpath.bootstrapcdn.com/bootstrap/4.3.1/js/bootstrap.min.js" integrity="sha384-JjSmVgyd0p3pXB1rRibZUAYoIIy6OrQ6VrjIEaFf/nJGzIxFDsf4x0xIM+B07jRM" crossorigin="anonymous"></script>
<div class="container">
<div class="row">
<div class="col-6 p-0"><img src="https://www.woodlandtrust.org.uk/media/100078482/Sycamore01.jpg?cb=-11897985&preset=gallery-tab-main-image" class="w-100 h-100"></div>
<div class="col-6 p-0"><img src="https://statesymbolsusa.org/sites/statesymbolsusa.org/files/styles/symbol_thumbnail__medium/public/primary-images/Applesfreshpicked.jpg?itok=YmYkBfY7" class="w-100 h-100"></div>
<div class="col-6 p-0"><img src="https://openbookphilly.com/wp-content/uploads/2016/11/bookstack.png" class="w-100 h-100"></div>
<div class="col-6 p-0"><img src="https://media.wired.com/photos/5b86fce8900cb57bbfd1e7ee/master/w_582,c_limit/Jaguar_I-PACE_S_Indus-Silver_065.jpgColumn" class="w-100 h-100"></div>
</div>
</div>
Even though pictures are smaller , they should touching edge to edge-
For some reason, this is not working
make images the same size in bootstrap grid
This is one way in CSS, looking for Bootstrap way, using grid-template-columns
CSS:
.grid-container {
display: grid;
grid-template-columns: 100px 100px;
grid-gap: 0em;
padding: 0px;
}
img {
width: 100%;
height: auto;
padding:0px;
}
HTML:
<div class="grid-container">
<img src="https://s3-us-west-2.amazonaws.com/s.cdpn.io/210284/san-fransisco-768x432.jpg" alt="san francisco">
<img src="https://s3-us-west-2.amazonaws.com/s.cdpn.io/210284/london-768x432.jpg" alt="london">
<img src="https://s3-us-west-2.amazonaws.com/s.cdpn.io/210284/new-york-768x432.jpg" alt="new york">
<img src="https://s3-us-west-2.amazonaws.com/s.cdpn.io/210284/cape-town-768x432.jpg" alt="cape town">
</div>
Another helpful site:
https://webdesign.tutsplus.com/tutorials/create-a-css-grid-image-gallery-with-blur-effect-and-interaction-media-queries--cms-32287
HTML Create an Equal Size Square Grid Picture System
Specify Number of Rows and Columns in Grid
HTML Specify Divider gap measurement in Square Grid Picture
Hopefully this will help you out?
<link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.3.1/css/bootstrap.min.css" integrity="sha384-ggOyR0iXCbMQv3Xipma34MD+dH/1fQ784/j6cY/iJTQUOhcWr7x9JvoRxT2MZw1T" crossorigin="anonymous">
<script src="https://code.jquery.com/jquery-3.3.1.slim.min.js" integrity="sha384-q8i/X+965DzO0rT7abK41JStQIAqVgRVzpbzo5smXKp4YfRvH+8abtTE1Pi6jizo" crossorigin="anonymous"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/popper.js/1.14.7/umd/popper.min.js" integrity="sha384-UO2eT0CpHqdSJQ6hJty5KVphtPhzWj9WO1clHTMGa3JDZwrnQq4sF86dIHNDz0W1" crossorigin="anonymous"></script>
<script src="https://stackpath.bootstrapcdn.com/bootstrap/4.3.1/js/bootstrap.min.js" integrity="sha384-JjSmVgyd0p3pXB1rRibZUAYoIIy6OrQ6VrjIEaFf/nJGzIxFDsf4x0xIM+B07jRM" crossorigin="anonymous"></script>
<div class="container">
<div class="row no-gutters">
<div class="col-md-6">
<img src="https://www.woodlandtrust.org.uk/media/100078482/Sycamore01.jpg?cb=-11897985&preset=gallery-tab-main-image" alt="Fruit" style="width:100%;height:400px">
</div>
<div class="col-md-6">
<img src="https://statesymbolsusa.org/sites/statesymbolsusa.org/files/styles/symbol_thumbnail__medium/public/primary-images/Applesfreshpicked.jpg" alt="Fruit" style="width:100%;height:400px">
</div>
<div class="col-md-6">
<img src="https://openbookphilly.com/wp-content/uploads/2016/11/bookstack.png" alt="Book" style="width:100%;height:400px">
</div>
<div class="col-md-6">
<img src="https://media.wired.com/photos/5b86fce8900cb57bbfd1e7ee/master/w_582,c_limit/Jaguar_I-PACE_S_Indus-Silver_065.jpg" alt="Book" style="width:100%;height:400px">
</div>
</div>
</div>
all images should be of same size e.g 512*512px.
<div class="row">
<div class="col-md-12 p-0">
<img src="https://www.woodlandtrust.org.uk/media/100078482/Sycamore01.jpg?cb=-11897985&preset=gallery-tab-main-image"
class="">
<img
src="https://statesymbolsusa.org/sites/statesymbolsusa.org/files/styles/symbol_thumbnail__medium/public/primary-images/Applesfreshpicked.jpg?itok=YmYkBfY7" style="margin-left:-4px;">
</div>
</div>
I am using Bootstrap 4 and I have row like this:
<link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.1.3/css/bootstrap.min.css" integrity="sha384-MCw98/SFnGE8fJT3GXwEOngsV7Zt27NXFoaoApmYm81iuXoPkFOJwJ8ERdknLPMO" crossorigin="anonymous">
<!-- Row -->
<div class="container">
<div class="row">
<div class="col-lg-4">
<img src="https://cdn.pixabay.com/photo/2018/10/15/18/32/bee-eaters-3749679_960_720.jpg" alt="" class="img-fluid">
<p>My First Text</p>
</div>
<div class="col-lg-4">
<img src="https://cdn.pixabay.com/photo/2013/04/04/12/34/sunset-100367_960_720.jpg" alt="" class="img-fluid">
<p>My Second Text</p>
</div>
<div class="col-lg-4">
<img src="https://cdn.pixabay.com/photo/2015/04/23/22/00/tree-736885_960_720.jpg" alt="" class="img-fluid">
<p>My Third Text</p>
</div>
</div>
</div>
<script src="https://code.jquery.com/jquery-3.3.1.slim.min.js" integrity="sha384-q8i/X+965DzO0rT7abK41JStQIAqVgRVzpbzo5smXKp4YfRvH+8abtTE1Pi6jizo" crossorigin="anonymous"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/popper.js/1.14.3/umd/popper.min.js" integrity="sha384-ZMP7rVo3mIykV+2+9J3UJ46jBk0WLaUAdn689aCwoqbBJiSnjAK/l8WvCWPIPm49" crossorigin="anonymous"></script>
<script src="https://stackpath.bootstrapcdn.com/bootstrap/4.1.3/js/bootstrap.min.js" integrity="sha384-ChfqqxuZUCnJSK3+MXmPNIyE6ZbWh2IMqE241rYiqJxyMiZ6OW/JmZQ5stwEULTy" crossorigin="anonymous"></script>
This works fine - but as soon as I decrease the browser size I have the images among themselves which is also expected. Nevertheless the images are now left aligned. So in the mobile view I want the images also horizontal centered but the corresponding text left aligned. When I add the "text-center" to the columns, the images are horizontal center but the text as well. So how can I center the image but leave the text left aligned to the left side of the image?
Instead of using text-center, use mx-auto d-block on the images...
<img src="..." alt="" class="img-fluid mx-auto d-block">
https://www.codeply.com/go/UU1RXLwRUE
i am using bootstrap card to create a basic image and text underneath.Decided to use card class since its a pretty good structure and didn't want to use too much css to make div list horizontally. what i want is like an image gallery with horizontal scroll like this
the problem is that card behavior is to get smaller as i add more cards . what is the issue here? , maybe i shouldn't use card-group?. maybe have to scrap bootstrap and write my own?
.card-group {
overflow-x: scroll;
white-space: nowrap;
max-width: 30rem;
padding: 1rem;
}
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<title>Document</title>
<script src="https://code.jquery.com/jquery-3.3.1.js" integrity="sha256-2Kok7MbOyxpgUVvAk/HJ2jigOSYS2auK4Pfzbm7uH60=" crossorigin="anonymous"></script>
<script src="https://stackpath.bootstrapcdn.com/bootstrap/4.1.3/js/bootstrap.min.js" integrity="sha384-ChfqqxuZUCnJSK3+MXmPNIyE6ZbWh2IMqE241rYiqJxyMiZ6OW/JmZQ5stwEULTy"
crossorigin="anonymous"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/popper.js/1.14.3/umd/popper.min.js" integrity="sha384-ZMP7rVo3mIykV+2+9J3UJ46jBk0WLaUAdn689aCwoqbBJiSnjAK/l8WvCWPIPm49"
crossorigin="anonymous"></script>
<script src="./index.js"></script>
<link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.1.3/css/bootstrap.min.css" integrity="sha384-MCw98/SFnGE8fJT3GXwEOngsV7Zt27NXFoaoApmYm81iuXoPkFOJwJ8ERdknLPMO"
crossorigin="anonymous">
</head>
<body>
<div class="container mt-4">
<div class="horzontal-scrollgallery">
<div class="card-group">
<div class="card pr-3">
<img class="card-img-top" src="./images/chicago.jpg" alt="Card image">
<div class="card-body text-center">
<h4 class="card-title">John Doe</h4>
</div>
</div>
<div class="card pr-3">
<img class="card-img-top" src="./images/chicago.jpg" alt="Card image">
<div class="card-body text-center">
<h4 class="card-title">John Doe</h4>
</div>
</div>
<div class="card pr-3">
<img class="card-img-top" src="./images/chicago.jpg" alt="Card image">
<div class="card-body text-center">
<h4 class="card-title">John Doe</h4>
</div>
</div>
<div class="card pr-3">
<img class="card-img-top" src="./images/chicago.jpg" alt="Card image">
<div class="card-body text-center">
<h4 class="card-title">John Doe</h4>
</div>
</div>
</div>
</div>
</div>
</body>
</html>
</body>
</html>
The reason why your cards are getting smaller is because .card-group is displayed as flex and its card items' flex-grow is set to 1, which means they will take up equal widths:
To get what you want, you can define a custom class along with its default .card-group (so that you don't override the default card-group styles), set its overflow style as well as its children <card>'s flex-basis so that they have a default width. You will need to set card-group's wrapping style to no-wrap as well as the default is set up wrap.
CSS
#media (min-width: 576px) {
.card-group.card-group-scroll {
overflow-x: auto;
flex-wrap: nowrap;
}
.card-group.card-group-scroll > .card {
flex-basis: 35%;
}
}
Result
fiddle: http://jsfiddle.net/b2jw13go/1/
I have one row inside which I have three columns like this:
<link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.1.3/css/bootstrap.min.css" integrity="sha384-MCw98/SFnGE8fJT3GXwEOngsV7Zt27NXFoaoApmYm81iuXoPkFOJwJ8ERdknLPMO" crossorigin="anonymous">
<section>
<div class="container">
<div class="row">
<div class="col-4">
<img class="img-fluid" src="https://via.placeholder.com/321x620" alt="" />
</div>
<div class="col-4">
<img class="img-fluid" src="https://via.placeholder.com/321x620" alt="" />
</div>
<div class="col-4">
<img class="img-fluid" src="https://via.placeholder.com/321x620" alt="" />
</div>
</div>
</div>
</section>
<script src="https://code.jquery.com/jquery-3.3.1.slim.min.js" integrity="sha384-q8i/X+965DzO0rT7abK41JStQIAqVgRVzpbzo5smXKp4YfRvH+8abtTE1Pi6jizo" crossorigin="anonymous"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/popper.js/1.14.3/umd/popper.min.js" integrity="sha384-ZMP7rVo3mIykV+2+9J3UJ46jBk0WLaUAdn689aCwoqbBJiSnjAK/l8WvCWPIPm49" crossorigin="anonymous"></script>
<script src="https://stackpath.bootstrapcdn.com/bootstrap/4.1.3/js/bootstrap.min.js" integrity="sha384-ChfqqxuZUCnJSK3+MXmPNIyE6ZbWh2IMqE241rYiqJxyMiZ6OW/JmZQ5stwEULTy" crossorigin="anonymous"></script>
I would like the three columns to overlap and create and illusion like the the following:
Where each bottle will represent each of the image that I have in the code snippet above.
Thanks for any help
Note The image in the middle should appear to be in the front and bigger than the other two images in the back (exactly as shown in the picture)
If you want to overlap all the time, instead of using grid you could use negative margins instead:
.bottle {
width: 100px;
height: auto;
border: 1px solid black;
}
.bottles .bottle:first-child {
margin-right: -30px;
}
.bottles .bottle:last-child {
position: relative;
margin-left: -30px;
z-index: -1;
}
<div class="bottles">
<img class="bottle" src="https://via.placeholder.com/321x620">
<img class="bottle" src="https://via.placeholder.com/321x620">
<img class="bottle" src="https://via.placeholder.com/321x620">
</div>
I resized images to fit inside snippet preview, but you will need only to play with negative margins to achieve effect you want.
I think this is what you're looking for from what I understood. I created a new class for each column and shifted it using the margins. You can adjust the margin % to fit your desired position.
<style>
.a1 {
margin-left: 15%;
position: absolute;
}
.a2 {
margin-left: 30%;
margin-top: 5%;
position: absolute;
z-index: 3;
}
.a3 {
margin-left: 45%;
position: absolute;
}
</style>
<section>
<div class="container">
<div class="row">
<div class="col-4 a1">
<img class="img-fluid" src="https://via.placeholder.com/321x620" alt="" />
</div>
<div class="col-4 a2">
<img class="img-fluid" src="https://via.placeholder.com/321x620" alt="" />
</div>
<div class="col-4 a3">
<img class="img-fluid" src="https://via.placeholder.com/321x620" alt="" />
</div>
</div>
</div>
</section>
Do you mean something like the following:
.col-4 {
position: relative;
}
.col-4:nth-child(1), .col-4:nth-child(3) {
z-index: 1;
}
.col-4:nth-child(2) {
margin: 0 -40px 0 -40px;
z-index: 2;
}
.img-fluid {
width: 321px;
height: 620px;
}
<link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.1.3/css/bootstrap.min.css" integrity="sha384-MCw98/SFnGE8fJT3GXwEOngsV7Zt27NXFoaoApmYm81iuXoPkFOJwJ8ERdknLPMO" crossorigin="anonymous">
<section>
<div class="container">
<div class="row">
<div class="col-4">
<img class="img-fluid" src="https://cdn.pixabay.com/photo/2018/08/21/23/29/fog-3622519_960_720.jpg" alt="" />
</div>
<div class="col-4">
<img class="img-fluid" src="https://cdn.pixabay.com/photo/2012/08/27/14/19/evening-55067_960_720.png" alt="" />
</div>
<div class="col-4">
<img class="img-fluid" src="https://cdn.pixabay.com/photo/2015/01/07/15/51/woman-591576_960_720.jpg" alt="" />
</div>
</div>
</div>
</section>
<script src="https://code.jquery.com/jquery-3.3.1.slim.min.js" integrity="sha384-q8i/X+965DzO0rT7abK41JStQIAqVgRVzpbzo5smXKp4YfRvH+8abtTE1Pi6jizo" crossorigin="anonymous"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/popper.js/1.14.3/umd/popper.min.js" integrity="sha384-ZMP7rVo3mIykV+2+9J3UJ46jBk0WLaUAdn689aCwoqbBJiSnjAK/l8WvCWPIPm49" crossorigin="anonymous"></script>
<script src="https://stackpath.bootstrapcdn.com/bootstrap/4.1.3/js/bootstrap.min.js" integrity="sha384-ChfqqxuZUCnJSK3+MXmPNIyE6ZbWh2IMqE241rYiqJxyMiZ6OW/JmZQ5stwEULTy" crossorigin="anonymous"></script>
Instead of using "col-4" use "col-sm-4" or here is the rule for column click
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0/css/bootstrap.min.css" integrity="sha384-Gn5384xqQ1aoWXA+058RXPxPg6fy4IWvTNh0E263XmFcJlSAwiGgFAW/dAiS6JXm" crossorigin="anonymous">
<section>
<div class="container">
<div class="row">
<div class="col-sm-4">
<img class="img-fluid" src="https://via.placeholder.com/321x620" alt="" />
</div>
<div class="col-sm-4">
<img class="img-fluid" src="https://via.placeholder.com/321x620" alt="" />
</div>
<div class="col-sm-4">
<img class="img-fluid" src="https://via.placeholder.com/321x620" alt="" />
</div>
</div>
</div>
</section>
I'm trying to make a block of 3 images, 2 are of the same size and 1 has double the width of the rest of them. I've searched here similar questions but they didn't work for me.
how to use no margin image side image in html, css <-- not working, tried another similar question too
HTML5 code is:
<head runat="server">
<meta name="viewport" content="width=device-width, initial-scale=1" />
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<link rel="icon" href="images/favicon.png">
<link href="css/bootstrap.css" rel="stylesheet" />
<link href="css/bootstrap-reboot.css" rel="stylesheet" />
<link href="css/custom.css" rel="stylesheet" />
<script src="js/jquery-3.3.1.min.js"></script>
<script src="js/popper.min.js"></script>
<script src="js/bootstrap.min.js"></script>
<script src="js/jquery.blockUI.js"></script>
</head>
<div class="container-fluid" style="max-height: 450px; max-width: 1380px;margin:0;padding:0;"><!-- tried without margin/padding as well -->
<div class="row">
<div class="col-3">
<img src="images/2.jpg" class="img-fluid" style="margin:0;padding:0;" />
</div>
<div class="col-3">
<img src="images/1.jpg" class="img-fluid" style="margin:0;padding:0;"/>
</div>
<div class="col-6">
<img src="images/3.jpg" class="img-fluid" style="margin:0;padding:0;"/>
</div>
</div>
</div>
Tried without margins/padding too with no results. I'm using Bootstrap 4 as base CSS, I currently have another CSS sheet i can edit if needed. It seems some CSS sheet is creating the margin after the other CSS is being applied but i can't seem to find it.
(https://imgur.com/a/wHkil2k)
What do you mean? The gaps between images you saw are the paddings from the columns. If you don't want them, simply adding bootstrap class .no-gutters on the .row element, per https://getbootstrap.com/docs/4.1/layout/grid/#no-gutters.
<div class="container-fluid">
<div class="row no-gutters">
<div class="col-3">
<img src="images/2.jpg" class="img-fluid" />
</div>
<div class="col-3">
<img src="images/1.jpg" class="img-fluid"/>
</div>
<div class="col-6">
<img src="images/3.jpg" class="img-fluid" />
</div>
</div>
</div>
fiddle: http://jsfiddle.net/aq9Laaew/158414/