How set three photos like this:
The photos cover all width only if i set in css width: 100vh for all, but then middle photo is disproportionate (black frames show how i would like it to look like):
When i set middle photo width individually is worst because even i set 100vh width everything is breaking and it looks like this:
Here is HTMl code:
<main>
<div class="container-fluid">
<div class="row justify-content-sm-center">
<div class="col-lg-4 col-md-6 col-sm-12">
<figure class="description">
<img src="img/projects/home/test2.jpg" class="img-fluid img">
</figure>
</div>
<div class="col-lg-4 col-md-6 col-sm-12">
<figure class="description">
<img src="img/projects/home/test1.jpg" class="img-fluid img">
</figure>
</div>
<div class="col-lg-4 col-md-6 col-sm-12">
<figure class="description">
<img src="img/projects/home/test2.jpg" class="img-fluid img">
</figure>
</div>
</div>
I dont know how to it and not to lose responsiveness.
You can use the Setting one column width in the Bootstrap Grid System.
Here's the documentation: https://getbootstrap.com/docs/4.0/layout/grid/#setting-one-column-width
This would be the code (Replace the column values with images or background-images):
<div class="row">
<div class="col">
1 of 3
</div>
<div class="col-6">
2 of 3 (wider)
</div>
<div class="col">
3 of 3
</div>
</div>
Related
So there two columns , i wanna fit my image inside my first column so my second column can go down!
enter image description here
my HTML :
<div class="container-fluid">
<div class="row">
<div class="col-lg-6 col-sm-12">
<div class="hero-image container-fluid">
<img class="man-with-laptop img-fluid"
src="https://demo.templateflip.com/super/images/illustrations/hello3.svg" alt="">
</div>
</div>
<div class="col-lg-6 col-sm-12">
<div class="hero-text-area container-fluid">
<p>HELLO!</p>
</div>
</div>
</div>
</div>
Try it like this below and see what happens.... 1 container, 1 row.
Also, it looks like you're adding a lot of your own CSS I can see from your class types. I think your added CSS is messing about with your layout and confusing Bootstrap.
<div class="container-fluid">
<div class="row">
<div class="col-lg-6 col-sm-12">
<img class="man-with-laptop img-fluid" src="https://demo.templateflip.com/super/images/illustrations/hello3.svg" alt="">
</div>
<div class="col-lg-6 col-sm-12">
<p>HELLO!</p>
</div>
</div>
</div>
So, I can put the 2 images in the same row, but since i wanted to add a subtitle to both images one now stay at the top and the other goes to another line.
Tried pretty much everything now but, I can't align them while i have the subtitle
<div class="container row-info">
<div class="row-fluid ">
<div class="col-sm-4 col-xs-12 text-right">
<figure class="figure">
<img src="imagens/info.png" class="img-fluid img-info">
<figcaption class="figure-caption text-center">Info</figcaption>
</figure>
</div>
<div class="col-sm-4 col-xs-12 text-let">
<figure class="figure">
<img src="imagens/idioma.png" class="img-fluid img-idioma">
<figcaption class="figure-caption text-center">Idioma</figcaption>
</figure>
</div>
</div>
</div>
I don't think your utilizing the col properly. Make sure that all the in a row equals to 12. Eg;
<div class="row">
<div class="col-6"> <img...> </div>
<div class="col-6"> <img...> </div>
</div>
If it's greater than 12, it would spill over below the row.
I am having a hard time getting 5 img-responsives classes in a row with bootstrap. I am new to bootstrap so I may be way off here but this is what I have right now.
HTML:
<div class="container" id="pics" >
<div class="row">
<div class="col-lg-3 col-md-6 text-center">
<div class="service-box">
<img class="img-responsive" src="img/usscreenshot.png">
<h3> Make a real time post with your friends!</h3>
</div>
</div>
<div class="col-lg-3 col-md-6 text-center">
<div class="service-box">
<img class="img-responsive" src="img/mainscreenshot-01.png">
<h3> Discover new groups of people nearby!</h3>
</div>
</div>
<div class="col-lg-3 col-md-6 text-center">
<div class="service-box">
<img class="img-responsive" src="img/conversationsscreenshot-01.png">
<h3>Chat with interesting groups!</h3>
</div>
</div>
<div class="col-lg-3 col-md-6 text-center">
<div class="service-box">
<img class="img-responsive" src="img/eventscreenshot-01.png">
<h3>Find cool places to go!</h3>
</div>
</div>
<div class="col-lg-3 col-md-6 text-center">
<div class="service-box">
<img class="img-responsive" src="img/eventscreenshot-01.png">
<h3>Find cool places to go!</h3>
</div>
</div>
</div>
</div>
</section>
I can get 4 img's in a nice row with proper spacing and it seems I have plenty of margin on either side for one more. I would like all 5 img's to be on one row and to all be responsive?
As far as mobile goes, I would only need 1 column scroll of all 5 images, I can get that to work just fine with what I have.
Thanks for any help.
You are using col-md-3 which will separate row in 4 equal column and the last column will move to next line instead set offset of 1 column and make each column of 2 point like col-md-2
<div class="container" id="pics" >
<div class="row">
<div class="col-md-2 col-md-offset-1 text-center">
<div class="service-box">
<img class="img-responsive" src="img/usscreenshot.png">
<h3> Make a real time post with your friends!</h3>
</div>
</div>
<div class="col-md-2 text-center">
<div class="service-box">
<img class="img-responsive" src="img/mainscreenshot-01.png">
<h3> Discover new groups of people nearby!</h3>
</div>
</div>
<div class="col-md-2 text-center">
<div class="service-box">
<img class="img-responsive" src="img/conversationsscreenshot-01.png">
<h3>Chat with interesting groups!</h3>
</div>
</div>
<div class="col-md-2 text-center">
<div class="service-box">
<img class="img-responsive" src="img/eventscreenshot-01.png">
<h3>Find cool places to go!</h3>
</div>
</div>
<div class="col-md-2 text-center">
<div class="service-box">
<img class="img-responsive" src="img/eventscreenshot-01.png">
<h3>Find cool places to go!</h3>
</div>
</div>
</div>
</div>
In my nested column (col-md-6) I included two rows. Unfortunately the (smaller) pictures in the second row do not horizontally align to the left with the first column and the rest of the whole page content. Is there any different margin in col-md-4 than in col-md-12 or is is there any other reason?
Thank you!
<div class="col-md-6 col-md-height">
<div class="row">
<div class="col-md-12">
<a href="images/e1/expose1.jpg" data-lightbox="roadtrip">
<img src="images/e1/expose1.jpg" class="center-block img-responsive" width="100%">
</a>
blabla
</div>
</div>
<div clas="row">
<div class="col-md-4">
<a href="images/e1/s1.jpg" data-lightbox="roadtrip">
<img src="images/e1/s1.jpg" class="img-responsive">
</a>
</div>
<div class="col-md-4">
<img src="images/e1/s2.jpg" class="img-thumbnail">
</div>
<div class="col-md-4">
<img src="images/e1/s3.jpg" class="img-thumbnail" >
</div>
</div>
</div>
It maybe because of the img-thumbnail class you are using on the last two images.
Try converting them to img-responsive
I'm not sure if I'm doing anything wrong but I'm getting a weird bug in a bootstrap grid when I resize my browser. It happens in a matter of a pixel and stops when I keep resizing. One of the images in the grid gets out of place and goes to the bottom. I'll attach a picture of the fail and another one of the normal.
Does anyone know what this bug is and how to fix it?
this is my code:
<section class="container-fluid">
<div class="row">
<div class="col-xs-12"> <img id="imgClickAndChange" src="img.jpg" onclick="changeImage(1)"/> </div>
</div>
<div class="row no-pad">
<div class="col-xs-12 col-md-6 col-lg-4">
<img class="grid" src="img1.jpg"/>
</div>
<div class="col-xs-12 col-md-6 col-lg-4">
<img class="grid" src="img2.jpg"/>
</div>
<div class="col-xs-12 col-md-6 col-lg-4">
<img class="grid" src="img1.jpg"/>
</div>
</div>
<div class="row no-pad">
<div class="col-xs-12 col-md-6 col-lg-4">
<img class="grid" src="img2.jpg"/>
</div>
<div class="col-xs-12 col-md-6 col-lg-4">
<img class="grid" src="img1.jpg"/>
</div>
<div class="col-xs-12 col-md-6 col-lg-4">
<img class="grid" src="img.jpg2"/>
</div>
</div>
</section>
Only css I used:
Btw it's a customized bootstrap (but the only thing I customized was the min width for a large screen from 1200px to 1900px and removed the grid glutter)
.grid { width: 100%;}
Thank you.
With Bootstrap, try applying the class img-responsive to your images to ensure they never exceed 100% width of their parent.
<img class="img-responsive" src="img1.jpg"/>
Documentation: http://getbootstrap.com/css/#images
If all the images are the same size, there is no issue:
https://jsbin.com/muzug/1/
https://jsbin.com/muzug/1/edit?html,css,output
Also, not necessary to have the col-xs-12, it will always be 100% under the last min-width class used.
Added a rounding error correction.
CSS:
.row.no-pad img {width:100.1%;}
.row.no-pad [class*="col-"] {padding:0;margin-bottom:-1px}
HTML
<section class="container-fluid">
<div class="row no-pad">
<div class="col-md-6 col-lg-4">
<img src="https://scontent-a-lhr.xx.fbcdn.net/hphotos-xap1/t31.0-8/1617132_1517052665201751_3430332756563801835_o.jpg">
</div>
<div class="col-md-6 col-lg-4">
<img src="https://scontent-a-lhr.xx.fbcdn.net/hphotos-xap1/t31.0-8/1617132_1517052665201751_3430332756563801835_o.jpg">
</div>
<div class="col-md-6 col-lg-4">
<img src="https://scontent-a-lhr.xx.fbcdn.net/hphotos-xap1/t31.0-8/1617132_1517052665201751_3430332756563801835_o.jpg">
</div>
<div class="col-md-6 col-lg-4">
<img src="https://scontent-a-lhr.xx.fbcdn.net/hphotos-xap1/t31.0-8/1617132_1517052665201751_3430332756563801835_o.jpg">
</div>
<div class="col-md-6 col-lg-4">
<img src="https://scontent-a-lhr.xx.fbcdn.net/hphotos-xap1/t31.0-8/1617132_1517052665201751_3430332756563801835_o.jpg">
</div>
<div class="col-md-6 col-lg-4">
<img src="https://scontent-a-lhr.xx.fbcdn.net/hphotos-xap1/t31.0-8/1617132_1517052665201751_3430332756563801835_o.jpg">
</div>
</div>
</div>