Parallax effect works in browser but not in mobile - html

I have added a parallax effect to my image gallery section in my website. The effect works great in normal desktop and responsive mode in the browsers. However, when I try to view the same in my mobile (iPhone 6), the background in the section does not stay fixed, but rather extends for the whole content of that section , making the background very zoomed in and pixelated.
This my html :
<section id="projects">
<div class="parallax">
<div class="container" style="padding-bottom: 30px;">
<div class="row">
<h3 class="section-header-inverse wow fadeInUp" data-wow-delay="200ms" data-wow-duration="500ms">Our Projects</h3>
</div>
<div class="row">
<div class="container">
<div class="gallery">
<div class="row">
<div class="container">
<div class="col-md-12">
<div class="col-sm-3">
<div class="thumbnail">
<img class="img img-responsive" src="http://placehold.it/300x250/ffffff" alt="" title="Beautiful Image" />
</div>
</div>
<div class="col-sm-3">
<div class="thumbnail">
<img class="img img-responsive" src="http://placehold.it/300x250/ffffff" alt="" title="" />
</div>
</div>
<div class="col-sm-3">
<div class="thumbnail">
<img class="img img-responsive" src="http://placehold.it/300x250/ffffff" alt="" title="Beautiful Image" />
</div>
</div>
<div class="col-sm-3">
<div class="thumbnail">
<img class="img img-responsive" src="http://placehold.it/300x250/ffffff" alt="" title="" />
</div>
</div>
<div class="clear"></div>
</div>
</div>
</div>
<div class="row">
<div class="container">
<div class="col-md-12">
<div class="col-sm-3">
<div class="thumbnail">
<img class="img img-responsive" src="http://placehold.it/300x250/ffffff" alt="" title="Beautiful Image" />
</div>
</div>
<div class="col-sm-3">
<div class="thumbnail">
<img class="img img-responsive" src="http://placehold.it/300x250/ffffff" alt="" title="" />
</div>
</div>
<div class="col-sm-3">
<div class="thumbnail">
<img class="img img-responsive" src="http://placehold.it/300x250/ffffff" alt="" title="Beautiful Image" />
</div>
</div>
<div class="col-sm-3">
<div class="thumbnail">
<img class="img img-responsive" src="http://placehold.it/300x250/ffffff" alt="" title="" />
</div>
</div>
<div class="clear"></div>
</div>
</div>
</div>
<div class="row">
<div class="container">
<div class="col-md-12">
<div class="col-sm-3">
<div class="thumbnail">
<img class="img img-responsive" src="http://placehold.it/300x250/ffffff" alt="" title="Beautiful Image" />
</div>
</div>
<div class="col-sm-3">
<div class="thumbnail">
<img class="img img-responsive" src="http://placehold.it/300x250/ffffff" alt="" title="" />
</div>
</div>
<div class="col-sm-3">
<div class="thumbnail">
<img class="img img-responsive" src="http://placehold.it/300x250/ffffff" alt="" title="Beautiful Image" />
</div>
</div>
<div class="col-sm-3">
<div class="thumbnail">
<img class="img img-responsive" src="http://placehold.it/300x250/ffffff" alt="" title="" />
</div>
</div>
<div class="clear"></div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</section>
This is the css for this section :
#projects {
text-align: center;
padding-bottom: 2%;
}
/*Project Section CSS*/
.parallax {
background-image: url('../images/backgrounds/bg.jpg');
/* Set a specific height */
/*height: 600px;*/
background-attachment: fixed;
background-position: center;
background-repeat: no-repeat;
background-size: cover;
}
.gallery img {
max-width: 100%;
max-height: 100%;
}
.gallery .row {
padding-bottom: 10px;
}
#media (max-width: 767px) {
.gallery .thumbnail {
padding-bottom: 7px;
}
}
.gallery .thumbnail {
-webkit-transition: all 150ms ease-out;
-moz-transition: all 150ms ease-out;
-o-transition: all 150ms ease-out;
transition: all 150ms ease-out;
}
.gallery .thumbnail:hover {
-webkit-transform: scale(1.05);
-moz-transform: scale(1.05);
-o-transform: scale(1.05);
-ms-transform: scale(1.05);
transform: scale(1.05);
-webkit-transition: all 150ms ease-in;
-moz-transition: all 150ms ease-in;
-o-transition: all 150ms ease-in;
transition: all 150ms ease-in;
}
I even tried to add vendor prefixes to the properties. But still it does not work. Please help me to get this working as expected.
The website can be accessed here

I am showing an example which works on every devices i.e. IPhone, IPad, Android, windows. The Methodology is different as you can see.
<!DOCTYPE html>
<html>
<head>
<title>Parallax</title>
</head>
<style>
.section-one {
position:relative;
height:662px;
}
.section-one:before {
content:'';
background:blue url('2.jpg') no-repeat;
position:fixed;
top:0;
left:0;
height:100%;
width:100%;
}
</style>
<body>
<section class="section-one"></section>
</body>
</html>

Related

Stuck with responsiveness in bootstrap 4.6

when i resize the browser my sections are mixing each other
one section has two rows and 12 images
then
new section starts
and it has only one header if i resize my chrome browser those things are mixing
but in inspect tools it is not mixing working very well
why is that
here is my code
.second-page {
height: 100vh;
}
.second-page img {
width: 230px;
height: 137px;
padding: 5px;
filter: grayscale(100%);
transition: .5s;
}
.second-page img:hover {
filter: grayscale(0%);
transform: scale(1.1);
transform: .3s;
}
/* second-page ends */
/* third-page starts */
.third-page {
height: 100vh;
}
<section class="second-page">
<h1 class="text-center my-5">Intended Projects</h1>
<div class="row">
<div class="col-md-12 my-5 text-center">
<img src="https://cdnuploads.aa.com.tr/uploads/Contents/2020/05/30/thumbs_b_c_a4a6996640e91d4ff86a71f5d9d9f84b.jpg?v=225920" alt="">
<img src="https://cdnuploads.aa.com.tr/uploads/Contents/2020/05/30/thumbs_b_c_a4a6996640e91d4ff86a71f5d9d9f84b.jpg?v=225920" alt="">
<img src="https://cdnuploads.aa.com.tr/uploads/Contents/2020/05/30/thumbs_b_c_a4a6996640e91d4ff86a71f5d9d9f84b.jpg?v=225920" alt="">
<img src="https://cdnuploads.aa.com.tr/uploads/Contents/2020/05/30/thumbs_b_c_a4a6996640e91d4ff86a71f5d9d9f84b.jpg?v=225920" alt="">
<img src="https://cdnuploads.aa.com.tr/uploads/Contents/2020/05/30/thumbs_b_c_a4a6996640e91d4ff86a71f5d9d9f84b.jpg?v=225920" alt="">
</div>
</div>
<div class="row">
<div class="col-md-12 col-sm-6 my-5 text-center">
<img src="https://cdnuploads.aa.com.tr/uploads/Contents/2020/05/30/thumbs_b_c_a4a6996640e91d4ff86a71f5d9d9f84b.jpg?v=225920" alt="">
<img src="https://cdnuploads.aa.com.tr/uploads/Contents/2020/05/30/thumbs_b_c_a4a6996640e91d4ff86a71f5d9d9f84b.jpg?v=225920" alt="">
<img src="https://cdnuploads.aa.com.tr/uploads/Contents/2020/05/30/thumbs_b_c_a4a6996640e91d4ff86a71f5d9d9f84b.jpg?v=225920" alt="">
<img src="https://cdnuploads.aa.com.tr/uploads/Contents/2020/05/30/thumbs_b_c_a4a6996640e91d4ff86a71f5d9d9f84b.jpg?v=225920" alt="">
<img src="https://cdnuploads.aa.com.tr/uploads/Contents/2020/05/30/thumbs_b_c_a4a6996640e91d4ff86a71f5d9d9f84b.jpg?v=225920" alt="">
</div>
</div>
</section>
<!-- second-page ends -->
<!-- third-page starts -->
<section class="third-page ">
<h1 class="text-center">Our Developers Team</h1>
</section>
Your issue is not clear, still i've made this section responsive!
Add link of image in href, replacing #.
The third section is merged in second! it has to be inside a .
<section class="second-page">
<h1 class="text-center my-5">Intended Projects</h1>
<div class="row">
<div class="col-md-12 my-5 text-center">
<img src="#" alt="">
<img src="#" alt="">
<img src="#" alt="">
<img src="#" alt="">
<img src="#" alt="">
</div>
</div>
<div class="row">
<div class="col-md-12 my-5 text-center">
<img src="#" alt="">
<img src="#" alt="">
<img src="#" alt="">
<img src="#" alt="">
<img src="#" alt="">
</div>
</div>
<div>
<h1 class="text-center">Our Developers Team</h1>
</div>
</section>

My col-xs-12 is ruining my row in tablet and desktop mode

.col-xs-15,
.col-sm-15,
.col-md-15,
.col-lg-15 {
position: relative;
min-height: 1px;
padding-right: 10px;
padding-left: 10px;
}
.col-md-15 img {
height: 200px;
width: 200px;
}
.margin20
{
margin-top: 20px;
}
/*new set of column*/
.col-xs-15 {
width: 20%;
float: left;
}
#media (min-width: 768px) {
/*even if i remove this nothing happen*/
.col-sm-15 {
width: 20%;
float: left;
}
}
#media (min-width: 992px) {
.col-md-15 {
width: 20%;
float: left;
}
}
#media (min-width: 1200px) {
.col-lg-15 {
width: 20%;
float: left;
}
}
*overlay*/
.img-container {
position: relative;
width: 100%;
}
.red {
background-color: #B2B2B2;
}
.image {
opacity: 1;
display: block;
width: 100%;
height: auto;
transition: .5s ease;
backface-visibility: hidden;
}
.middle {
transition: .5s ease;
opacity: 0;
position: absolute;
top: 50%;
left: 50%;
transform: translate(-50%, -50%);
-ms-transform: translate(-50%, -50%)
}
.img-container .image {
opacity: 0.3;
}
.img-container .middle {
opacity: 1;
}
.text {
background-color: transparent;
color: white;
font-size: 24px;
padding: 16px 32px;
font-family: 'Archivo Black', sans-serif;
text-align: center;
}
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="stylesheet" href="Custom.css" type="text/css"/>
<link rel="stylesheet" type="text/css" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css">
<link rel="stylesheet" type="text/css" href="https://maxcdn.bootstrapcdn.com/font-awesome/4.7.0/css/font-awesome.min.css">
<link href="https://fonts.googleapis.com/css?family=Lato|Ubuntu" rel="stylesheet">
<link href="https://fonts.googleapis.com/css?family=Archivo+Black" rel="stylesheet">
<div class="container">
<div class="row">
<div class="col-md-15 col-sm-15 col-xs-12">
<div class="img-container red">
<img src="https://introcs.cs.princeton.edu/java/stdlib/mandrill200x200.jpg" alt="Avatar" class="image" style="width:100%">
<div class="middle">
<div class="text">MEN'S APPAREL</div>
</div>
</div>
</div>
<div class="col-md-15 col-sm-15 col-xs-12">
<div class="img-container red">
<img src="https://introcs.cs.princeton.edu/java/stdlib/mandrill200x200.jpg" alt="Avatar" class="image" style="width:100%">
<div class="middle">
<div class="text">MEN'S APPAREL</div>
</div>
</div>
</div>
<div class="col-md-15 col-sm-15 col-xs-12">
<div class="img-container red">
<img src="img/sample.png" alt="Avatar" class="image" style="width:100%">
<div class="middle">
<div class="text">MEN'S APPAREL</div>
</div>
</div>
</div>
<div class="col-md-15 col-sm-15 col-xs-12">
<div class="img-container red">
<img src="https://introcs.cs.princeton.edu/java/stdlib/mandrill200x200.jpg" alt="Avatar" class="image" style="width:100%">
<div class="middle">
<div class="text">MEN'S APPAREL</div>
</div>
</div>
</div>
<div class="col-md-15 col-sm-15 col-xs-12">
<div class="img-container red">
<img src="https://introcs.cs.princeton.edu/java/stdlib/mandrill200x200.jpg" alt="Avatar" class="image" style="width:100%">
<div class="middle">
<div class="text">MEN'S APPAREL</div>
</div>
</div>
</div>
</div>
<div class="row margin20">
<div class="col-md-15 col-sm-15 col-xs-12">
<div class="img-container red">
<img src="https://introcs.cs.princeton.edu/java/stdlib/mandrill200x200.jpg" alt="Avatar" class="image" style="width:100%">
<div class="middle">
<div class="text">MEN'S APPAREL</div>
</div>
</div>
</div>
<div class="col-md-15 col-sm-15 col-xs-12">
<div class="img-container red">
<img src="https://introcs.cs.princeton.edu/java/stdlib/mandrill200x200.jpg" alt="Avatar" class="image" style="width:100%">
<div class="middle">
<div class="text">MEN'S APPAREL</div>
</div>
</div>
</div>
<div class="col-md-15 col-sm-15 col-xs-12">
<div class="img-container red">
<img src="https://introcs.cs.princeton.edu/java/stdlib/mandrill200x200.jpg" alt="Avatar" class="image" style="width:100%">
<div class="middle">
<div class="text">MEN'S APPAREL</div>
</div>
</div>
</div>
<div class="col-md-15 col-sm-15 col-xs-12">
<div class="img-container red">
<img src="https://introcs.cs.princeton.edu/java/stdlib/mandrill200x200.jpg" alt="Avatar" class="image" style="width:100%">
<div class="middle">
<div class="text">MEN'S APPAREL</div>
</div>
</div>
</div>
<div class="col-md-15 col-sm-15 col-xs-12">
<div class="img-container red">
<img src="https://introcs.cs.princeton.edu/java/stdlib/mandrill200x200.jpg" alt="Avatar" class="image" style="width:100%">
<div class="middle">
<div class="text">MEN'S APPAREL</div>
</div>
</div>
</div>
</div>
</div>
I want to divide my row in 5 equal parts that is why i used col-md-15 and col-sm-15, it is working well in tablet,mobile,and desktop (if you will remove the col-xs-12 in every tag), however in mobile mode i want the images to be 1 per row that is why i inserted col-xs-12, however when i did that, the rows in tablet and desktop mode became 1 per row and stretched which is i dont want. How to fix this problem?
<link rel="stylesheet" type="text/css" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css">
<link rel="stylesheet" type="text/css" href="https://maxcdn.bootstrapcdn.com/font-awesome/4.7.0/css/font-awesome.min.css">
<link rel="stylesheet" href="Custom.css" type="text/css"/>
You load custom css before bootstrap css, switch that around.
Edited the example, sry, I meant the other way around. Custom css last, so it overrides the other code.

Boostrap image not responsive in safari

I realized my website is not working on safari (desktop and mobile). For some reason the images are not responsive. I used a Bootstrap theme, the website is simple. Please help!
website: www.scanek.com
HTML:
<section id="portfolio" class="pfblock">
<div class="container">
<div class="row">
<div class="col-sm-6 col-sm-offset-3">
<div class="pfblock-header wow fadeInUp">
<h2 class="pfblock-title">Categories</h2>
<div class="pfblock-subtitle">
</div>
</div>
</div>
</div><!-- .row -->
<div class="row">
<div class="col-xs-12 col-sm-6 col-md-4 col-lg-4">
<div class="grid wow zoomIn">
<a href="categories/kitchen/index.html">
<figure class="effect-bubba">
<img src="assets/images/kitchens.jpg" alt="img01" class="img-responsive" />
<figcaption>
<h2> <span>Kitchens</span></h2>
<p></p>
</figcaption>
</figure>
</a>
</div>
</div>
<div class="col-xs-12 col-sm-6 col-md-4 col-lg-4">
<div class="grid wow zoomIn">
<a href="categories/bathroom//bathroom1/index.html">
<figure class="effect-bubba">
<img src="assets/images/bathrooms.jpg" alt="img01"/>
<figcaption>
<h2> <span>Bathrooms</span></h2>
<p></p>
</figcaption>
</figure>
</a>
</div>
</div>
<div class="col-xs-12 col-sm-6 col-md-4 col-lg-4">
<div class="grid wow zoomIn">
<a href="categories/fixtures/index.html">
<figure class="effect-bubba">
<img src="assets/images/fixtures.jpg" alt="img01"/>
<figcaption>
<h2>House<span> Fixtures</span></h2>
<p></p>
</figcaption>
</figure>
</a>
</div>
</div>
</div>
</div><!-- .container -->
</section>
CSS:
img {
max-width: 100%;
width: 100%;
height: auto;
}
.grid figure img {
position: relative;
display: block;
min-height: 100%;
max-width: 100%;
opacity: 0.8;
}
figure.effect-bubba img {
opacity: 0.75;
-webkit-transition: opacity 0.35s;
transition: opacity 0.35s;
}
Your css syntaks on link that you provide to us is not right, for the start,
you have:
img {
max-width: 100% width :100% height: auto;
}
try with :
img {
max-width: 100%;
width :100%;
height: auto;
}
after yo fix this issues, then if problem is still there we can try to help you..
In addiion to the CSS typo on img width(should be width: 100%;), you had .img-reponsive only on one image set.
Set .img-responsive on all images.
Check resizing on following fiddle: https://jsfiddle.net/Syden/5mfvj9v2/20/
Snippet below:
img {
max-width: 100%;
width: 100%;
height: auto;
}
.grid figure img {
position: relative;
display: block;
min-height: 100%;
max-width: 100%;
opacity: 0.8;
}
figure.effect-bubba img {
opacity: 0.75;
-webkit-transition: opacity 0.35s;
transition: opacity 0.35s;
}
<link href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css" rel="stylesheet" />
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.1.1/jquery.min.js"></script>
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/js/bootstrap.min.js"></script>
<section id="portfolio" class="pfblock">
<div class="container">
<div class="row">
<div class="col-sm-6 col-sm-offset-3">
<div class="pfblock-header wow fadeInUp">
<h2 class="pfblock-title">Categories</h2>
<div class="pfblock-subtitle">
</div>
</div>
</div>
</div>
<!-- .row -->
<div class="row">
<div class="col-xs-12 col-sm-6 col-md-4 col-lg-4">
<div class="grid wow zoomIn">
<a href="categories/kitchen/index.html">
<figure class="effect-bubba">
<img src="https://placehold.it/200x500" alt="img01" class="img-responsive" />
<figcaption>
<h2> <span>Kitchens</span></h2>
<p></p>
</figcaption>
</figure>
</a>
</div>
</div>
<div class="col-xs-12 col-sm-6 col-md-4 col-lg-4">
<div class="grid wow zoomIn">
<a href="categories/bathroom//bathroom1/index.html">
<figure class="effect-bubba">
<img src="https://placehold.it/200x500" alt="img01" class="img-responsive" />
<figcaption>
<h2> <span>Bathrooms</span></h2>
<p></p>
</figcaption>
</figure>
</a>
</div>
</div>
<div class="col-xs-12 col-sm-6 col-md-4 col-lg-4">
<div class="grid wow zoomIn">
<a href="categories/fixtures/index.html">
<figure class="effect-bubba">
<img src="https://placehold.it/200x500" alt="img01" class="img-responsive" />
<figcaption>
<h2>House<span> Fixtures</span></h2>
<p></p>
</figcaption>
</figure>
</a>
</div>
</div>
</div>
</div>
<!-- .container -->
</section>

How to adjust overlay according to image size with bootstrap

I am trying to create responsive images which can have different sizes. So far i am able to solve the common size issue with max-height, but the overlay is still a problem, hence it is filling the width of the column.
HTML
<div class="container">
<div class="row team-images">
<div class="col-sm-3">
<div class="team-item">
<div class="team-image-overlay"></div>
<img src="http://placehold.it/400x300" class="img-responsive" alt="" />
</div>
</div>
<div class="col-sm-3">
<div class="team-item">
<div class="team-image-overlay"></div>
<img src="http://placehold.it/400x300" class="img-responsive" alt="" />
</div>
</div>
<div class="col-sm-3">
<div class="team-item">
<div class="team-image-overlay"></div>
<img src="http://placehold.it/400x300" class="img-responsive" alt="" />
</div>
</div>
<div class="col-sm-3">
<div class="team-item">
<div class="team-image-overlay"></div>
<img src="http://placehold.it/400x300" class="img-responsive" alt="" />
</div>
</div>
<div class="col-sm-3">
<div class="team-item">
<div class="team-image-overlay"></div>
<img src="http://placehold.it/400x400" class="img-responsive" alt="" />
</div>
</div>
<div class="col-sm-3">
<div class="team-item">
<div class="team-image-overlay"></div>
<img src="http://placehold.it/400x400" class="img-responsive" alt="" />
</div>
</div>
<div class="col-sm-3">
<div class="team-item">
<div class="team-image-overlay"></div>
<img src="http://placehold.it/400x300" class="img-responsive" alt="" />
</div>
</div>
</div>
</div>
CSS
body {
margin: 10px;
}
.team-images .team-item {
position: relative;
}
.team-images img {
width: auto;
max-height: 100px;
margin: 0 0 15px;
}
.team-images .team-image-overlay {
position: absolute;
top: 0;
width: 100%;
height: 100%;
background-color: rgba(41, 128, 185, 0.4);
color: #fff;
-webkit-transition: all ease .5s;
-moz-transition: all ease .5s;
transition: all ease .5s;
}
.team-images .team-image-overlay:hover {
background: rgba(24, 188, 156, 0);
}
DEMO: https://jsfiddle.net/prp794Lb/5/
Demo
.team-item {
display:inline-block;
background:red;
margin-bottom:10px;
}
This will solve your problem :)
https://jsfiddle.net/prp794Lb/8/
This is a workaround with javascript. The only issue is that images have class image responsive that will make for images with 400x400 the overlay a little bigger.
$(".team-item").each(function(){
var width = $(this).find("img").width();
$(".team-image-overlay").width(width);
var height = $(this).find("img").height();
$(".team-image-overlay").height(height);
});
$( window ).resize(function() {
$(".team-item").each(function(){
var width = $(this).find("img").width();
$(".team-image-overlay").width(width);
var height = $(this).find("img").height();
$(".team-image-overlay").height(height);
});
});

Get the images straight to the div width

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