taking a beginner HTML/Bootstrap/CSS etc. course so I'm pretty new to all of this.
I'm trying to align these three "Bootstrap Thumbnail Custom Content" elements next to each other, but I don't have any idea how: http://imgur.com/NChc9UA
I basically need to make it look like it does on their site: http://getbootstrap.com/components/#thumbnails
Here's my code:
<div class="row">
<div class="col-sm-6 col-md-4">
<div class="thumbnail">
<img src="images/obliviontn.jpg" alt="Oblivion">
<div class="caption">
<h3>Let's Play Oblivion</h3>
<p>One of Grohlvana's most popular series, Let's Play Oblvion is a lengthy LP that explores Tamriel in Bethesda's epic fourth Elder Scrolls title.</p>
<p>Watch</p>
</div>
</div>
<div class="row">
<div class="col-sm-6 col-md-4">
<div class="thumbnail">
<img src="images/skyrimtn.jpg" alt="Skyrim">
<div class="caption">
<h3>Skyrim's Hidden Treasures</h3>
<p>Grohlvana's most popular and unique series, Skyrim's Hidden Treasures explores locations in the fifth Elder Scrolls game that aren't tied to any specific quest</p>
<p>Watch</p>
</div>
</div>
<div class="row">
<div class="col-sm-6 col-md-4">
<div class="thumbnail">
<img src="images/fallout3tn.jpg" alt="Fallout 3">
<div class="caption">
<h3>Let's Play Fallout 3</h3>
<p>The current in-progress Let's Play on Grohlvana's channel. Watch as Jack scours the wasteland in hopes to save its various inhabitants.</p>
<p>Watch</p>
</div>
</div>
Again, really new to this so please try to explain thoroughly. Not sure if this is an HTML or CSS issue.
Thanks for any help.
If you notice, each of your three code snippets above have the same parent container i.e. <div class="row">. The .row div is a block-level element with a 100% width which is why your three columns aren't getting aligned in one line. What you can do is that wrap your three columns inside one single <div class="row"> like this:
<div class="row">
<div class="col-sm-6 col-md-4">
<div class="thumbnail">
<img src="images/obliviontn.jpg" alt="Oblivion">
<div class="caption">
<h3>Let's Play Oblivion</h3>
<p>One of Grohlvana's most popular series, Let's Play Oblvion is a lengthy LP that explores Tamriel in Bethesda's epic fourth Elder Scrolls title.</p>
<p>Watch</p>
</div>
</div>
</div>
<div class="col-sm-6 col-md-4">
<div class="thumbnail">
<img src="images/fallout3tn.jpg" alt="Fallout 3">
<div class="caption">
<h3>Let's Play Fallout 3</h3>
<p>The current in-progress Let's Play on Grohlvana's channel. Watch as Jack scours the wasteland in hopes to save its various inhabitants.</p>
<p>Watch</p>
</div>
</div>
</div>
<div class="col-sm-6 col-md-4">
<div class="thumbnail">
<img src="images/skyrimtn.jpg" alt="Skyrim">
<div class="caption">
<h3>Skyrim's Hidden Treasures</h3>
<p>Grohlvana's most popular and unique series, Skyrim's Hidden Treasures explores locations in the fifth Elder Scrolls game that aren't tied to any specific quest</p>
<p>Watch</p>
</div>
</div>
</div>
</div>
Also, in the code which you've posted above, you were missing a lot of closing </div> tags.
Here's a demo using your code (view as full page):
<link href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.0/css/bootstrap-theme.min.css" rel="stylesheet" />
<link href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.0/css/bootstrap.min.css" rel="stylesheet" />
<div class="row">
<div class="col-sm-6 col-md-4">
<div class="thumbnail">
<img src="images/obliviontn.jpg" alt="Oblivion">
<div class="caption">
<h3>Let's Play Oblivion</h3>
<p>One of Grohlvana's most popular series, Let's Play Oblvion is a lengthy LP that explores Tamriel in Bethesda's epic fourth Elder Scrolls title.</p>
<p>Watch
</p>
</div>
</div>
</div>
<div class="col-sm-6 col-md-4">
<div class="thumbnail">
<img src="images/fallout3tn.jpg" alt="Fallout 3">
<div class="caption">
<h3>Let's Play Fallout 3</h3>
<p>The current in-progress Let's Play on Grohlvana's channel. Watch as Jack scours the wasteland in hopes to save its various inhabitants.</p>
<p>Watch
</p>
</div>
</div>
</div>
<div class="col-sm-6 col-md-4">
<div class="thumbnail">
<img src="images/skyrimtn.jpg" alt="Skyrim">
<div class="caption">
<h3>Skyrim's Hidden Treasures</h3>
<p>Grohlvana's most popular and unique series, Skyrim's Hidden Treasures explores locations in the fifth Elder Scrolls game that aren't tied to any specific quest</p>
<p>Watch
</p>
</div>
</div>
</div>
</div>
jsFiddle Demo.
Related
This is the current layout for my bootstrap website. Unfortunately it isn't working as the columns are completely off on md sizes.
Here is the current view.
My goal is to have them grouped by 2 columns on md sizes. So the layout would be image+text;new column;image+text;new column;image+text
<div class="row">
<div class="col-lg-4 col-md-6 coko">
<img src="images/malinica.jpg" class="img-responsive img-rounded" alt="Cokol">
<a class="link" href="#"><div class="preko">
<h3 class="text-center">Cakes</h3></div></a>
</div>
<div class="col-lg-4 col-md-6 coko">
<p class="text-center">In 1995, The Rolling Pin
opened its first location on a quiet street corner in the heart of
Munich. From its inception, The Rolling Pin has been cherished for its
classic Germany baked goods, vintage decor and warm, invitig atmosphere.
</p>
</div>
<div class="col-lg-4 coko col-md-6">
<img src="images/cupcake.jpg" class="img-responsive img-rounded" alt="Coko">
<a class="link" href="#"><div class="preko">
<h3 class="text-center">Muffins</h3>
</div></a>
</div>
</div>
<div class="row">
<div class="col-lg-4 coko col-md-6">
<h3 class="text-center">We stand for organic</h3>
<p class="text-center">The Rolling Pin has a whole line of organic
desserts and drinks that prove that eating organic can taste just as
delicious.</p>
</div>
<div class="col-lg-4 col-md-6 coko">
<img src="images/kafa.jpg" class="img-responsive img-rounded" alt="Coko">
<a class="link" href="#"><div class="preko">
<h3 class="text-center">Drinks</h3>
</div></a>
</div>
<div class="col-lg-4 col-md-6 coko">
<h3 class="text-center">Pet friendly</h3>
<p>If you have a dog or cat, this is the right place for
you. Except our place, we offer you a special menu for your pet.</p>
</div>
</div>
See if this helps:
https://codepen.io/panchroma/pen/geYeep
There are 2 challenges with a layout like this.
Firstly you want to have all your elements in the same row, and secondly, you need to allow for columns being different heights. nth child selectors and some #media selectors are an efficient way manipulate the CSS and make it work.
HTML - this is exactly the same as yours except for a couple of lines commented out so all the elements are in the same row
<div class="row">
<div class="col-lg-4 col-md-6 coko">
<img src="http://www.fillmurray.com/500/400" class="img-responsive img-rounded" alt="Cokol">
<a class="link" href="#">
<div class="preko">
<h3 class="text-center">Cakes</h3>
</div>
</a>
</div>
<div class="col-lg-4 col-md-6 coko">
<p class="text-center">In 1995, The Rolling Pin opened its first location on a quiet street corner in the heart of Munich. From its inception, The Rolling Pin has been cherished for its classic Germany baked goods, vintage decor and warm, invitig
atmosphere.
</p>
</div>
<div class="col-lg-4 coko col-md-6">
<img src="http://www.fillmurray.com/500/200" class="img-responsive img-rounded" alt="Coko">
<a class="link" href="#">
<div class="preko">
<h3 class="text-center">Muffins</h3>
</div>
</a>
</div>
<!-- </div> -->
<!-- <div class="row"> -->
<div class="col-lg-4 coko col-md-6">
<h3 class="text-center">We stand for organic</h3>
<p class="text-center">The Rolling Pin has a whole line of organic desserts and drinks that prove that eating organic can taste just as delicious.
</p>
</div>
<div class="col-lg-4 col-md-6 coko">
<img src="http://www.fillmurray.com/500/300" class="img-responsive img-rounded" alt="Coko">
<a class="link" href="#">
<div class="preko">
<h3 class="text-center">Drinks</h3>
</div>
</a>
</div>
<div class="col-lg-4 col-md-6 coko">
<h3 class="text-center">Pet friendly</h3>
<p>If you have a dog or cat, this is the right place for you. Except our place, we offer you a special menu for your pet.</p>
</div>
</div>
CSS - the first media query ensures that every third column floats left to the start of a new row at an md viewport.
The other is to compensate for the removal of the second row div in your HTML
#media (max-width: 1199px) {
.row div:nth-child(odd){
clear:left
}
}
#media (min-width: 1200px) {
.row div:nth-child(3n + 4){
clear:left
}
}
Good luck!
It's because min-height problem. Add extra div and min-height.
or
Add min-height for your .coko div.
This question already has an answer here:
Bootstrap 3 - Aligning column height
(1 answer)
Closed 6 years ago.
Beginner here, I am building a one page bootstrap site, I have divided the site into sections, i have already added 1st image as the background in section one.
I have tried using the columns but no vial.
I cant get the two images side by side like shown in the prototype (http://imgur.com/a/MJQ2w).
I want the page layout to be like this with no margins but i am unable to do this with bootstrap. Please help me with your expertise.
<header style="background-image: url('static/assets/home-bg.jpg');">
<div class="intro-content">
<div class="brand-name">Learning & Experience</div>
<hr class="colored">
<div class="brand-name-subtext">Lorem Ipsum Dolor Init
</div>
</div>
<div class="scroll-down">
<a class="btn page-scroll" href="#about"><i class="fa fa-angle-down fa-fw"></i></a>
</div>
</header>
<section id="about">
<div class="container-fluid">
<div class="row row-no-gutter">
<div class="col-md-6 img-responsive">
<img src="static/assets/training.png">
</div>
<div class="col-md-6 img-responsive">
<img src="static/assets/recruit.png" >
</div>
</div>
</div>
<div>
Check my example here, Without removes any padding provide by bootstrap
HTML
<section class="values">
<div class="col-md-4 box text-white box blues">
<div class="box-home">
<h4>our values</h4>
<p>At MOCAZ PRIME, with the expertise of experienced traders, we join in giving the best advice and knowledge to individuals to ensure their financial goals can be achieved in any market conditions.</p>
<div class="icon-text">
<p>01.</p>
</div>
</div>
</div>
<div class="col-md-4 text-white box bg-city blacks">
<div class="box-home">
<h4>our philipsophy</h4>
<p>It is our ambition to keep up challenges of a dynamic and changing market. Consequently it is necessary to flexibly bring new techniques which meet the needs of our customers. This all predetermines us to achieve a leading position in the global financial advisory services.</p>
<div class="icon-text">
<p>02.</p>
</div>
</div>
</div>
<div class="col-md-4 text-white box blacks">
<div class="box-home">
<h4>our mission</h4>
<p>Our mission is to facilitate a world-class foreign exchange, metal and contracts for difference trading environment. We're dedicated to providing industry-leading technology to the international trading community and we strive to deliver educational tools and resources that enable traders to further develop their trading skills.</p>
<div class="icon-text">
<p>03.</p>
</div>
</div>
</div>
</section>
DEMO
Replace your code
<div class="col-md-6 img-responsive">
<img src="static/assets/training.png">
</div>
<div class="col-md-6 img-responsive">
<img src="static/assets/recruit.png" >
</div>
With following line of code
<div class="col-md-6">
<img src="static/assets/training.png" class=" img-responsive" />
</div>
<div class="col-md-6">
<img src="static/assets/recruit.png" class=" img-responsive" />
</div>
Fixed the issue, Thanks guys.
<section id="about">
<div class="container-fluid">
<div class="row" id="port2-second-row">
<div class="col-xs-6 imgcont" id="port2-first-col">
<img src="static/assets/training.png" alt="training" />
</div> <!-- end col-sm-6 -->
<div class="col-xs-6 imgcont" id="port2-second-col">
<img src="static/assets/recruit.png" alt="recruit" />
</div> <!-- end col-sm-6 -->
</div> <!-- end port-second-row -->
CSS :
img {
width: 100%;
height: 100%;}
.imgcont {
padding: 0px;
I've made a grid of 6 using two rows with columns and was trying to make it so when the screen resizes from large to small it rearranges from 3 to 2 to 1. But I can't seem to make that work, I could have sworn the last time I used bootstrap to do this it was working. What happens is as the screen resizes, the profiles start to overlap over each other. What I have tried to do is add a css line for each resolution and increase the width percentage which seems to work, but I feel like it's not a clean approach.
here is the code:
<!-- Spotlight -->
<section id="spotlight">
<div class="container">
<div class="row">
<div class="col-md-12">
<div class="col-md-4">
<div class="card card-3">
<img src="http://convio.cancer.ca/mIFE/img/spotlight/man4.jpg">
<h3>Xanthe</h3>
<p>Inspired by the movie Tangled, Xanthe's goal was to grow her hair down to her ankles - but now wants to help cancer patients by donating her hair and raising funds to support the fight against cancer. Xanthe raised over $1,000 in honour of her
cousin who is battling leukemia.
</p>
</div>
</div>
<div class="col-md-4">
<div class="card card-3">
<img src="http://convio.cancer.ca/mIFE/img/spotlight/man4.jpg">
<h3>Team Gary</h3>
<p>Team Gary recently ran in the Mississauga Marathon to support their Grandfather, Father and Family member Gary who is currently fighting liver cancer. The team of 13 raised an incredible $4,455 in the fight against cancer. Way to go Team Gary!</p>
</div>
</div>
<div class="col-md-4">
<div class="card card-3">
<img src="http://convio.cancer.ca/mIFE/img/spotlight/man4.jpg">
<h3>Johnny Blonde Kitchen</h3>
<p>This year they were very excited to be opening a storefront location. They raised $1,300 by fundraising online, and donating 10% of sales from opening day. In addition to fundraising, Jonny cut off his famous locks and donated several inches
to Locks Of Love. We are so excited to have them be a part of our CCS family!</p>
</div>
</div>
</div>
<div class="row">
<div class="col-md-4">
<div class="card card-3">
<img src="http://convio.cancer.ca/mIFE/img/spotlight/man4.jpg">
<h3>Brevitas Consulting</h3>
<p>Brevitas Consulting takes on Breast Cancer Awareness Month each October with a walk-a-thon held one weekend during October bringing together their team in a fun, uplifting event. Thank you Brevitas!
</p>
</div>
</div>
<div class="col-md-4">
<div class="card card-3">
<img src="http://convio.cancer.ca/mIFE/img/spotlight/man4.jpg">
<h3>Irudaya</h3>
<p>These talented young women created and executed a two hour dance production; Journey: A Glimpse Into Tamil Cinema. With the Society being one of their charities of choice, these dancers raised $10,000 for the fight against cancer! Amazing work!</p>
</div>
</div>
<div class="col-md-4">
<div class="card card-3">
<img src="http://convio.cancer.ca/mIFE/img/spotlight/man4.jpg">
<h3>Maureen Parent</h3>
<p>Maureen is a breast cancer survivor who is dedicate to raising funds for cancer research. In 10 years she has raised over $85,000 with an annual pasta dinner and has her sights set on raising $1,000,000 for the fight against breast cancer.</p>
</div>
</div>
</div>
<div class="row text-center">
<div class="col-sm-12">
<div class="col-sm-12">
<div class="addPad">
<p>Be a cancer fighter <a class="btn btn-primary btn-lg btn-padin" id="hideshow2">Get Started</a></p>
</div>
</div>
</div>
</div>
</div>
</div>
</section>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script>
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/js/bootstrap.min.js"></script>
<link href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css" rel="stylesheet" />
<!-- Spotlight -->
<section id="spotlight">
<div class="container">
<div class="row">
<div class="col-md-12">
<div class="col-md-4">
<div class="card card-3">
<img src="http://convio.cancer.ca/mIFE/img/spotlight/man4.jpg">
<h3>Xanthe</h3>
<p>Inspired by the movie Tangled, Xanthe's goal was to grow her hair down to her ankles - but now wants to help cancer patients by donating her hair and raising funds to support the fight against cancer. Xanthe raised over $1,000 in honour of
her cousin who is battling leukemia.
</p>
</div>
</div>
<div class="col-md-4">
<div class="card card-3">
<img src="http://convio.cancer.ca/mIFE/img/spotlight/man4.jpg">
<h3>Team Gary</h3>
<p>Team Gary recently ran in the Mississauga Marathon to support their Grandfather, Father and Family member Gary who is currently fighting liver cancer. The team of 13 raised an incredible $4,455 in the fight against cancer. Way to go Team Gary!</p>
</div>
</div>
<div class="col-md-4">
<div class="card card-3">
<img src="http://convio.cancer.ca/mIFE/img/spotlight/man4.jpg">
<h3>Johnny Blonde Kitchen</h3>
<p>This year they were very excited to be opening a storefront location. They raised $1,300 by fundraising online, and donating 10% of sales from opening day. In addition to fundraising, Jonny cut off his famous locks and donated several inches
to Locks Of Love. We are so excited to have them be a part of our CCS family!</p>
</div>
</div>
</div>
<div class="row">
<div class="col-md-4">
<div class="card card-3">
<img src="http://convio.cancer.ca/mIFE/img/spotlight/man4.jpg">
<h3>Brevitas Consulting</h3>
<p>Brevitas Consulting takes on Breast Cancer Awareness Month each October with a walk-a-thon held one weekend during October bringing together their team in a fun, uplifting event. Thank you Brevitas!
</p>
</div>
</div>
<div class="col-md-4">
<div class="card card-3">
<img src="http://convio.cancer.ca/mIFE/img/spotlight/man4.jpg">
<h3>Irudaya</h3>
<p>These talented young women created and executed a two hour dance production; Journey: A Glimpse Into Tamil Cinema. With the Society being one of their charities of choice, these dancers raised $10,000 for the fight against cancer! Amazing
work!</p>
</div>
</div>
<div class="col-md-4">
<div class="card card-3">
<img src="http://convio.cancer.ca/mIFE/img/spotlight/man4.jpg">
<h3>Maureen Parent</h3>
<p>Maureen is a breast cancer survivor who is dedicate to raising funds for cancer research. In 10 years she has raised over $85,000 with an annual pasta dinner and has her sights set on raising $1,000,000 for the fight against breast cancer.</p>
</div>
</div>
</div>
<div class="row text-center">
<div class="col-sm-12">
<div class="col-sm-12">
<div class="addPad">
<p>Be a cancer fighter <a class="btn btn-primary btn-lg btn-padin" id="hideshow2">Get Started</a>
</p>
</div>
</div>
</div>
</div>
</div>
</div>
</section>
to give you a better idea of what's happening here's a screenshot of when the screen reaches 991px
Any suggestion is greatly appreciated! thanks for your time
Update
Restructured the HTML according to W3S, still gives me the same overlapping issue.
<section id="spotlight">
<div class="container">
<div class="row">
<div class="col-sm-4">
<div class="card card-3">
<img src="http://convio.cancer.ca/mIFE/img/spotlight/xanthe.jpg">
<h3>Xanthe</h3>
<p> </p>
</div>
</div>
<div class="col-sm-4">
<div class="card card-3">
<img src="http://convio.cancer.ca/mIFE/img/spotlight/TeamGary.jpg">
<h3>Team Gary</h3>
<p></p>
</div>
</div>
<div class="col-sm-4">
<div class="card card-3">
<img src="http://convio.cancer.ca/mIFE/img/spotlight/Johnny.jpg">
<h3>Johnny Blonde Kitchen</h3>
<p></p>
</div>
</div>
</div>
<div class="row">
<div class="col-sm-4">
<div class="card card-3">
<img src="http://convio.cancer.ca/mIFE/img/spotlight/Brevitas.jpg">
<h3>Brevitas Consulting</h3>
<p></p>
</div>
</div>
<div class="col-sm-4">
<div class="card card-3">
<img src="http://convio.cancer.ca/mIFE/img/spotlight/irudaya.jpg">
<h3>Irudaya</h3>
<p></p>
</div>
</div>
<div class="col-sm-4">
<div class="card card-3">
<img src="http://convio.cancer.ca/mIFE/img/spotlight/MaureenParent.jpg">
<h3>Maureen Parent</h3>
<p></p>
</div>
</div>
</div>
<div class="row text-center">
<div class="col-sm-12">
<div class="col-sm-12">
<div class="addPad">
<p>Be a cancer fighter <a class="btn btn-primary btn-lg btn-padin" id="hideshow2">Get Started</a></p>
</div>
</div>
</div>
</div>
</div>
</section>
The images are the problem here. Add class="img-responsive" to the image tag and it should fix it for you. At a certain width, the image size gets bigger than the column width and hence it overlaps.
I'm trying to troubleshoot an issue with using a bootstrap template for mobile...
I never want the text to overlay over an image, however I can't seem to find any straight answer on how to avoid it happening.
Here is the code currently:
<div class="banner-bottom" id="photos">
<div class="container">
<div class="bottom-grids">
<div class="col-md-3 bottom-grid">
<img src="images/bed.jpg" height="200px">
</div>
<div class="col-md-3 bottom-grid">
<p><b>Philosophy:</b><br> We believe meaningful activities provide an atmosphere of good health and spiritual well-being. The activity program is designed to offer opportunities for friendship and self-worth.</p>
</div>
<div class="col-md-3 bottom-grid">
<img src="images/entry.jpg" height="200px">
</div>
<div class="col-md-3 bottom-grid">
<p><b>Location:</b><br>Located just minutes from downtown Sacramento. Near the Jefferson Boulevard & West Capital Avenue intersection. Close to shopping, churches and senior centers.</p>
</div>
<div class="clearfix"></div>
</div>
</div>
</div>
There is nothing tricky in the CSS -- typical bootstrap 25% width for col-md-3.
.col-md-3 {
width: 25%;
}
How can I make my text areas well defined enough so they don't overlay my images? I would assume setting each div as col-md-3 with a 25% width would be enough to avoid this issue, but I'm obviously missing something.
You should use col-** classes only inside row class elements. col-** classes are floated items and row class has all needed clearfix styles and negative margins. Something like this:
<div class="banner-bottom" id="photos">
<div class="container">
<div class="row bottom-grids">
<div class="col-md-3 col-sm-3 bottom-grid">
<img src="images/bed.jpg" height="200px">
</div>
<div class="col-md-3 col-sm-3 bottom-grid">
<p><b>Philosophy:</b><br> We believe meaningful activities provide an atmosphere of good health and spiritual well-being. The activity program is designed to offer opportunities for friendship and self-worth.</p>
</div>
<div class="col-md-3 col-sm-3 bottom-grid">
<img src="images/entry.jpg" height="200px">
</div>
<div class="col-md-3 col-sm-3 bottom-grid">
<p><b>Location:</b><br>Located just minutes from downtown Sacramento. Near the Jefferson Boulevard & West Capital Avenue intersection. Close to shopping, churches and senior centers.</p>
</div>
<div class="clearfix"></div>
</div>
</div>
Also, bootstrap does lots of work for you and I'm sure you do not need those .bottom-grid classes and class="clearfix" div over there. Keep it as much simple as you can and you will see you markup improving.
One more thing is giving your img elements max-width: 100%; height: auto;, cause now they are overlapping their parent col- containers.
Try making use of "row" class and for smaller screen use "col-sm-*" based on your need to display.
This is just a sample edit to help you start with something:
<div class="banner-bottom" id="photos">
<div class="container">
<div class="row bottom-grids">
<div class="col-md-3 col-sm-3 bottom-grid">
<img src="images/bed.jpg" height="200px">
</div>
<div class="col-md-3 col-sm-3 bottom-grid">
<p><b>Philosophy:</b><br> We believe meaningful activities provide an atmosphere of good health and spiritual well-being. The activity program is designed to offer opportunities for friendship and self-worth.</p>
</div>
<div class="col-md-3 col-sm-3 bottom-grid">
<img src="images/entry.jpg" height="200px">
</div>
<div class="col-md-3 col-sm-3 bottom-grid">
<p><b>Location:</b><br>Located just minutes from downtown Sacramento. Near the Jefferson Boulevard & West Capital Avenue intersection. Close to shopping, churches and senior centers.</p>
</div>
<div class="clearfix"></div>
</div>
</div>
Please do add class="img-responsive" to img tag as below
Do not set height to img tag.
<div class="banner-bottom" id="photos">
<div class="container">
<div class="bottom-grids">
<div class="col-md-3 bottom-grid">
<img class="img-responsive" src="images/bed.jpg">
</div>
<div class="col-md-3 bottom-grid">
<p><b>Philosophy:</b><br> We believe meaningful activities provide an atmosphere of good health and spiritual well-being. The activity program is designed to offer opportunities for friendship and self-worth.</p>
</div>
<div class="col-md-3 bottom-grid">
<img class="img-responsive" src="images/entry.jpg">
</div>
<div class="col-md-3 bottom-grid">
<p><b>Location:</b><br>Located just minutes from downtown Sacramento. Near the Jefferson Boulevard & West Capital Avenue intersection. Close to shopping, churches and senior centers.</p>
</div>
<div class="clearfix"></div>
</div>
</div>
</div>
I have a web page here where I use Bootstrap grid system. It should display three items per column but if you scroll down to like row 3/4 the items start to be misaligned. I noticed that if only one item is slightly longer than the component below, the whole grid becomes quite a mess afterwards.
Here is code for one item in the whole grid system:
<div class="col-sm-12 col-xs-12 col-md-6 col-lg-4">
<h4 align="center"><strong>Name</strong></h4>
<div class="row" align="center">
<div class="image-cropper">
<!... personal image...>
</div>
<div class="center-justified">
<!.. sth sth blah blah..>
</div>
</div>
</div>
Does anyone has any idea how this can be fixed?
EDIT: What I am trying to achieve is to display every three columns per row on the large screen and then when it shrinks it should only display every two columns per row on medium screen and full row for small screen.
At the moment, if I wrap a container/row around every three columns, when I resize it to medium screen size (having only two items per row) there will be a white gap when the class switches from .col-lg-4 to .col-md-6. And I want to get rid of that white gap.
For every two column put them in containers like such this will give the result your looking for :
<div class="container">
<div class="col-md-6">
Your code here...
</div>
<div class="col-md-6">
Your code here...
</div>
</div>
Then just do this for every two people you write about on your website. Hope this helped.
please try this below code
<div class="container">
<!--Row 1-->
<div class="col-sm-4 col-xs-4 col-md-4 col-lg-4">
<h4 align="center"><strong>Martin Sandve Alnæs</strong></h4>
<div class="row" align="center">
<div class="image-cropper">
<div class="mugshot2" alt='Martin Sandve Alnæs' style='background: url(/_static/images/mugshots/alnaes.jpg) no-repeat 50% 50%' ></div>
</div>
<div class="center-justified">
<p>Martin is a postdoctoral fellow at Simula Research Laboratory.
</p>
<p>He has been involved with the FEniCS Project since 2006,
is the main developer of UFL and SFC, and one of the
developers of UFC, Instant, SyFi and DOLFIN.</p>
<p>You can view all Martin’s contributions on <a
href="https://bitbucket.org/martinal">his Bitbucket
page.</a></p>
</div>
</div>
</div>
<div class="col-sm-4 col-xs-4 col-md-4 col-lg-4">
<h4 align="center"><strong>Jan Blechta</strong></h4>
<div class="row" align="center">
<div class="image-cropper">
<div class="mugshot2" alt='Jan Blechta' style='background: url(/_static/images/mugshots/blechta.jpg) no-repeat 50% 50%' ></div>
</div>
</div>
<div class="center-justified">
<p>
Jan is a PhD. student of
Mathematical Modelling
at the
Charles University in Prague.
</p>
<p>
He has been involved with the FEniCS project since 2013 and is a
developer and maintainer of DOLFIN and Instant.
</p>
<p>You can view all Jan’s contributions on <a
href="https://bitbucket.org/blechta">his Bitbucket
page.</a></p>
</div>
</div>
<div class="col-sm-4 col-xs-4 col-md-4 col-lg-4">
<h4 align="center"><strong>Johan Hake</strong></h4>
<div class="row" align="center">
<div class="image-cropper">
<div class="mugshot2" alt='Johan Hake' style='background: url(/_static/images/mugshots/hake.jpg) no-repeat 50% 50%' ></div>
</div>
</div>
<div class="center-justified">
<p>Johan is a postdoctoral fellow at Simula Research Laboratory.
</p>
<p>He has been involved with the FEniCS Project since 2007,
is a maintainer of the Python interface of DOLFIN, and is
a developer of Instant, UFC and FFC.</p>
<p>You can view all Johans’s contributions on <a
href="https://bitbucket.org/johanhake">his Bitbucket
page.</a></p>
</div>
</div>
<div class="clearfix visible-*-block"></div>
<!--End of Row 1-->
<!--Row 2 -->
<div class="col-sm-4 col-xs-4 col-md-4 col-lg-4">
<h4 align="center"><strong>Johan Hoffman</strong></h4>
<div class="row" align="center">
<div class="image-cropper">
<div class="mugshot2" alt='Johan Hoffman' style='background: url(/_static/images/mugshots/hoffman.jpg) no-repeat 50% 50%' ></div>
</div>
</div>
<div class="center-justified">
<p>Johan is a professor at the KTH Royal Institute of Technology.
</p>
<p>He has been involved with the FEniCS Project since 2003
and is a developer of DOLFIN and Unicorn.</p>
</div>
</div>
<div class="col-sm-4 col-xs-4 col-md-4 col-lg-4">
<h4 align="center"><strong>Johan Jansson</strong></h4>
<div class="row" align="center">
<div class="image-cropper">
<div class="mugshot2" alt='Johan Jansson' style='background: url(/_static/images/mugshots/jansson.jpg) no-repeat 50% 50%' ></div>
</div>
</div>
<div class="center-justified">
<p>Johan is a senior researcher at the <a href="http://www.kth.se/">KTH Royal Institute of
Technology</a>.</p>
<p>He has been involved with the FEniCS Project since 2004
and is a developer of DOLFIN and Unicorn.</p>
</div>
</div>
<div class="col-sm-4 col-xs-4 col-md-4 col-lg-4">
<h4 align="center"><strong>Benjamin Kehlet</strong></h4>
<div class="row" align="center">
<div class="image-cropper">
<div class="mugshot2" alt='Benjamin Kehlet' style='background: url(/_static/images/mugshots/kehlet.jpg) no-repeat 50% 50%' ></div>
</div>
</div>
<div class="center-justified">
<p>Benjamin is a Ph.D. student at
Simula Research Laboratory and the
University of Oslo.
</p>
<p>He has been involved with the FEniCS Project since 2011
and is the primary developer of msrh, the FEniCS meshing component.
</p>
<p>You can view all Benjamin’s contributions on <a
href="https://bitbucket.org/kehlet">his Bitbucket
page.</a></p>
</div>
</div>