Complicated layout in bootstrap - html

I made this complicated layout in bootstrap but, the point is when I remove to image below on the right side, all other images changing smaller.
How can I have this always same size?
I tried to work with numbers for width and height but the result was bad!
The number of images will change based on the titles so I might have 3 images or 2 or 5.
Please help me!
Before removing
After removing
.container-fluid .expo {
margin-left: 20px;
margin-right: 20px;
text-align: center;
float: none;
margin-bottom: 20px;
}
.expoinfo {
display: inline-block;
padding: 0;
}
.expoinfo h3 {
font-size: 22px;
margin-top: 0px;
padding-right: 20px;
text-align: left;
}
.bigimg {
padding: 0;
border-radius: 0;
margin: 0;
overflow: hidden;
text-align: center;
}
.bigimg img {
border-radius: 0;
width: 100%;
padding-left: 2px;
padding-right: 2px;
padding-top: 2px;
padding-bottom: 2px;
height: 100%;
}
.colthumb {
overflow: hidden;
margin: 0;
padding: 0;
float: left;
}
.thumbnail {
padding: 0;
margin: 0;
border-style: none;
}
.thumbnail img {
width: 100%;
padding-top: 2px;
padding-right: 2px;
padding-left: 2px;
padding-bottom: 2px;
border-radius: 0;
border-style: none;
height: 100%;
}
<div class="container-fluid expo">
<div class="row expoinfo">
<section class="col-lg-10 col-lg-offset-1">
<h3>title</h3>
<div class="bigimg col-sm-6 col-md-6 col-lg-6">
<a href="http://fakeimg.pl/700x400/" title="">
<img src="http://fakeimg.pl/600x600/" alt="">
</a>
</div>
<div class="colthumb col-sm-3 col-xs-6 col-md-3 col-lg-3">
<div class="thumbnail">
<a href="http://fakeimg.pl/700x400/" title="">
<img src="http://fakeimg.pl/300x300/" alt="">
</a>
</div>
</div>
<div class="colthumb col-sm-3 col-xs-6 col-md-3 col-lg-3">
<div class="thumbnail">
<a href="http://fakeimg.pl/700x400/" title="">
<img src="http://fakeimg.pl/300x300/" alt="">
</a>
</div>
</div>
<div class="colthumb col-sm-3 col-xs-6 col-md-3 col-lg-3">
<div class="thumbnail">
<a href="http://fakeimg.pl/700x400/" title="">
<img src="http://fakeimg.pl/300x300/" alt="">
</a>
</div>
</div>
<div class="colthumb col-sm-3 col-xs-6 col-md-3 col-lg-3">
<div class="thumbnail">
<a href="http://fakeimg.pl/700x400/" title="">
<img src="http://fakeimg.pl/300x300/" alt="">
</a>
</div>
</div>
</section>
</div>
</div>

The example you made didn't include bootstrap.css even though it was using bootstrap's classes.
See updated demo: https://jsfiddle.net/2aLdmvw4/

I just found my answer!
<div class="row">
<section class="col-lg-offset-2 col-lg-8">
<h3>title</h3>
<div class=" thumbcol col-md-4 col-lg-6">
<div class="thumbnail"><img src="http://fakeimg.pl/300x300/" alt="Thumbnail Image">
</div>
</div>
<div class=" thumbcol col-md-4 col-lg-3">
<div class="thumbnail"><img src="http://fakeimg.pl/300x300/" alt="Thumbnail Image"> </div>
</div>
<div class=" thumbcol col-md-4 col-lg-3">
<div class="thumbnail"><img src="http://fakeimg.pl/300x300/" alt="Thumbnail Image"></div>
</div>
<div class=" thumbcol col-md-4 col-lg-3">
<div class="thumbnail"><img src="http://fakeimg.pl/300x300/" alt="Thumbnail Image"></div>
</div>
</section>
</div>

Related

Bootstrap 3 .img-responsive images are not responsive images inside links

I am use Bootstrap 3 and have a problem. Some of my images in row responsive normal, but images with links on insta and vk are not responsive. The size of images are 40x40
Code below
.navbar-default-footer {
background-color: white;
text-align: center;
margin-bottom: 0;
}
div.col-lg-4.col-md-4.col-xs-4 img {
margin-left: auto;
margin-right: auto;
display: inline;
}
.footer_text {
font-size: 5px;
color: #708090;
margin-bottom: 0px;
}
<nav class="navbar navbar-default-footer" role="navigation">
<div class="container-fluid">
<div class="row">
<div class="col-lg-4 col-md-4 col-xs-4">
<img src="images/Originals/example2.jpg" class="img-responsive">
</div>
<div class="col-lg-4 col-md-4 col-xs-4">
<img src="images/insta_40x40.jpg" class="img-responsive">
<img src="images/vk_40x40.jpg" class="img-responsive">
</div>
<div class="col-lg-4 col-md-4 col-xs-4">
<img src="images/Originals/example2.jpg" class="img-responsive">
</div>
</div>
<div class="container">
<div class="row">
<div class="col-lg-12 col-md-12 col-xs-12">
<p class="footer_text">
Свадебные прически в Виннице. Людмила Кулик. Все права защищены, любое копирование и использование материала запрещено без согласия автора.</p>
</div>
</div>
</div>
</div>
</nav>
Thanks all for help!
It's because a elements are display: inline; by default. Set the a elements to be display: inline-block; or display: block;.

Bootstrap nav tabs...where to put 100% on ul and 20% to each tab to fill the entire space?

Bootstrap nav tabs...where to put 100% on ul and 20% to each tab to fill the entire space?
I'd like my five bootstrap nav tabs to be spread out evenly across the containers. Currently they are in the middle, but there is so much blank space on the left and right sides of the tabs.
I think if I put my UL to be 100% and have each tab at 20% it may work. But where do I put those values?
Also, when I click "Grape Trees", it just shows the same information as "Bananas". Why won't it change?
here's my bootply:
http://www.bootply.com/GB3f0moehB
Here's my HTML:
<div class="content-section-c">
<div class="container">
<div class="row">
<div class="col-lg-12">
<h2>Sample Search Results</h2>
</div>
<div class="tabbable">
<ul class="nav nav-tabs">
<li class="active"><a href="#pane1" data-toggle="tab">APPLE<br>
TREES
</a></li>
<li>ORANGE<br>TREES</li>
<li>PEARS <br> TREES</li>
<li>BANANAS<br> </li>
<li>GRAPE<br> TREES</li>
</ul>
<div class="tab-content">
<div id="pane1" class="tab-pane active">
<p class="results">126 Results Founds</p>
<div class="col-md-6 col-xs-12">
<img class="img-responsive" src="http://www.onvia.com/responsive/01_card.png"></div>
<div class="col-md-6 col-xs-12">
<img class="img-responsive" src="http://www.onvia.com/responsive/02_card.png"></div>
<div class="col-md-6 col-xs-12">
<img class="img-responsive" src="http://www.onvia.com/responsive/03_card.png"></div>
<div class="col-md-6 col-xs-12">
<img class="img-responsive" src="http://www.onvia.com/responsive/04_card.png"></div>
</div>
<div id="pane2" class="tab-pane">
<p class="results">75 Results Founds</p>
<div class="col-md-6 col-xs-12">
<img class="img-responsive" src="http://www.onvia.com/responsive/05_card.png"></div>
<div class="col-md-6 col-xs-12">
<img class="img-responsive" src="http://www.onvia.com/responsive/06_card.png"></div>
<div class="col-md-6 col-xs-12">
<img class="img-responsive" src="http://www.onvia.com/responsive/07_card.png"></div>
<div class="col-md-6 col-xs-12">
<img class="img-responsive" src="http://www.onvia.com/responsive/08_card.png"></div>
</div>
<div id="pane3" class="tab-pane">
<p class="results">144 Results Founds</p>
<div class="col-md-6 col-xs-12">
<img class="img-responsive" src="http://www.onvia.com/responsive/09_card.png"></div>
<div class="col-md-6 col-xs-12">
<img class="img-responsive" src="http://www.onvia.com/responsive/10_card.png"></div>
<div class="col-md-6 col-xs-12">
<img class="img-responsive" src="http://www.onvia.com/responsive/11_card.png"></div>
<div class="col-md-6 col-xs-12">
<img class="img-responsive" src="http://www.onvia.com/responsive/12_card.png"></div>
</div>
<div id="pane4" class="tab-pane">
<p class="results">170 Results Founds</p>
<div class="col-md-6 col-xs-12">
<img class="img-responsive" src="http://www.onvia.com/responsive/01_card.png"></div>
<div class="col-md-6 col-xs-12">
<img class="img-responsive" src="http://www.onvia.com/responsive/02_card.png"></div>
<div class="col-md-6 col-xs-12">
<img class="img-responsive" src="http://www.onvia.com/responsive/03_card.png"></div>
<div class="col-md-6 col-xs-12">
<img class="img-responsive" src="http://www.onvia.com/responsive/04_card.png"></div>
</div>
<div id="pane5" class="tab-pane">
<p class="results">256 Results Founds</p>
<div class="col-md-6 col-xs-12">
<img class="img-responsive" src="http://www.onvia.com/responsive/01_card.png"></div>
<div class="col-md-6 col-xs-12">
<img class="img-responsive" src="http://www.onvia.com/responsive/02_card.png"></div>
<div class="col-md-6 col-xs-12">
<img class="img-responsive" src="http://www.onvia.com/responsive/03_card.png"></div>
<div class="col-md-6 col-xs-12">
<img class="img-responsive" src="http://www.onvia.com/responsive/04_card.png"></div>
</div>
</div><!-- /.tab-content -->
</div><!-- /.tabbable -->
</div>
</div>
<!-- /.container -->
</div>
<!-- /.content-section-c -->
Here's my CSS:
.content-section-c {
padding: 50px 0;
background-color: #d4d4d4;
}
h2 {
font-family: 'Lato', sans-serif;
font-weight: 700;
color: #3C5A78;
line-height: 1;
text-align:center;
padding: 0 0 16px 0;
}
.nav-tabs>li.active>a, .nav-tabs>li.active>a:focus, .nav-tabs>li.active>a:hover{
border-top: none;
border-left: none;
border-right: none;
border-bottom: 3px solid #e9a39c;
font-weight: bold;
background-color: #d4d4d4 !important;
}
.nav-tabs>li>a:hover{
border: 1px solid transparent;
}
.nav>li>a:focus, .nav>li>a:hover{
background-color: #d4d4d4;
}
.nav-tabs{
border-bottom: none;
display: inline-block; /* needed to center the list items */
}
.tabbable{
text-align: center;
}
.results {
font-family: 'Merriweather', serif;
font-weight: 300;
color: #355A78;
font-size: 16px;
margin: 20px 0 5px 0;
text-align: left;
}
Add width: 100% to .nav-tabs and create a new style for li as below
.nav-tabs li {
width: 20%;
}
http://www.bootply.com/93t8KTXgnA
.nav-tabs {width: 100%} .nav-tabs > li {width: 20%;}
+
You should change attr href of Grapes
`<li>GRAPE<br> TREES</li> `
Make the parent ul ".nav-tabs" 100% so it should fill the width of the container. Then make each li element under the ".nav-tabs" 20%:
.nav-tabs{
border-bottom: none;
display: inline-block; /* needed to center the list items */
width: 100%;
}
.nav-tabs>li {
width: 20%;
}

How can i make this grid layout always stay the same size bootstrap 3?

I'm trying to make a grid layout with images inside, The images aren't always the same size, Some of them seem to make the layout of the grid slightly smaller and i can't figure out a way to get them all the same size.
Here's the HTML.
<div class="col-xs-12">
<div class="row">
<h2>Handheld Consoles</h2>
<div class="col-xs-6 col-sm-6 col-md-4 col-lg-4">
<a href="#">
<div class="tile purple text-center">
<h3 class="title">Nintendo 3DS</h3>
<div class="col-xs-12"><img class="img-responsive" style="max-height:128px; max-width:128px" src="../images/3ds.png" /></div>
</div>
</a>
</div>
<div class="col-xs-6 col-sm-6 col-md-4 col-lg-4">
<a href="#">
<div class="tile red text-center">
<h3 class="title">Nintendo GBA</h3>
<div class="col-xs-12"><img class="img-responsive" style="max-height:128px; max-width:128px" src="../images/gba.png" /></div>
</div>
</a>
</div>
<div class="col-xs-6 col-sm-6 col-md-4 col-lg-4">
<a href="#">
<div class="tile orange text-center">
<h3 class="title">Nintendo 64</h3>
<div class="col-xs-12"><img class="img-responsive" style="max-height:128px; max-width:128px" src="../images/n64.png" /></div>
</div>
</a>
</div>
<div class="col-xs-6 col-sm-6 col-md-4 col-lg-4">
<a href="#">
<div class="tile green text-center">
<h3 class="title">Sony PSP</h3>
<div class="col-xs-12"><img class="img-responsive" style="max-height:128px; max-width:128px" src="../images/psp.png" /></div>
</div>
</a>
</div>
</div>
</div>
And the CSS.
.tile {
width:100%;
display: inline-block;
box-sizing: border-box;
background: #fff;
padding: 15px;
margin-bottom: 20px;
color:#fff;
}
.title {
margin-top: 0px;
text-align:center;
}
.purple {
background: #5133AB;
}
.purple:hover {
background: #3e2784;
}
i believe if you just set the height of class .tile, it should work
.tile {
width:100%;
display: inline-block;
box-sizing: border-box;
background: #fff;
padding: 15px;
margin-bottom: 20px;
color:#fff;
height: 200px; // or whatever height you want all the tiles to be
}

bootstrap box spaning rows right side img element

there's some problems with responsive grid system to me.
http://imageshack.com/a/img537/9687/4H48G0.jpg
http://imageshack.com/a/img539/8265/ANvr0Y.jpg - problem is here
My source code:
CSS
<style type="text/css">
.wrapper {
height: 100%;
text-align: center;
margin: 0 auto;
}
img { max-width:100% !important;
height:auto;
display:block;
}
.text {
color: #fff;
text-shadow:0px 2px 10px #000;
height: 100%;
left: 0;
position: absolute;
text-align: center;
top: 0;
font-size: 22px;
width: 100%;}
.box {
border: 1px dashed #000;
overflow: hidden;
position: relative;
}
.tb_floater {
font-size: 1.5em;
margin-top: 20%;
padding-top: 10%;
}
.box.tall {
height: 300px;
}
.box.tall > a > img {
height: auto;
}
</style>
HTML
<div class="wrapper">
<div class="container">
<div class="row">
<div class="col-md-4 box tall">
<a href="#">
<img src="http://www.websailer.com/wp-content/uploads/2013/07/www_image.jpg">
</a>
<div class="text tall">
<div class="tb_floater">
<p>Loren ipsum shit amet<br/>Loren ipsum</p>
</div>
</div>
</div>
<div class="col-xs-6 col-md-6 box" style="height:150px;">.col-xs-6 .col-md-6</div>
<div class="col-xs-6 col-md-2 box" style="height:150px;">.col-xs-6 .col-md-2</div>
<div class="col-xs-6 col-md-2 box" style="height:150px;">.col-xs-6 .col-md-2</div>
<div class="col-xs-6 col-md-6 box" style="height:150px;">.col-xs-6 .col-md-6</div>
</div>
<div class="row">
<div class="pull-right col-xs-6 col-md-4 box tall">
<a href="#">
<img src="http://www.websailer.com/wp-content/uploads/2013/07/www_image.jpg">
</a>
<div class="text tall">
<div class="tb_floater">
<p>Loren ipsum shit amet<br/>Loren ipsum</p>
</div>
</div>
</div>
<div class="col-xs-6 col-md-2 box" style="height:150px;">.col-xs-6 .col-md-6</div>
<div class="col-xs-6 col-md-6 box" style="height:150px;">.col-xs-6 .col-md-2</div>
<div class="col-xs-6 col-md-2 box" style="height:150px;">.col-xs-6 .col-md-6</div>
<div class="col-xs-6 col-md-6 box" style="height:150px;">.col-xs-6 .col-md-2</div>
</div>
That empty field is problem when i resize the browser, any solution ?

rows getting pushed down by long column in bootstrap

I'm trying to make a layout like this using bootstrap.
However, I keep getting this
Does anyone know how to prevent the second row from being pushed down by the large column?
Here is a skeleton of my HTML:
<div class="container">
<div class="row">
<div class="col-xs-6 col-sm-6 col-md-6 about">
<img >
</div>
<div class="col-xs-3 col-sm-3 col-md-3 resume">
<img >
</div>
<div class="col-xs-3 col-sm-3 col-md-3 websites">
<img >
</div>
</div>
<div class="row">
<div class="col-xs-3 col-sm-3 col-md-3 waterfall">
<img >
</div>
<div class="col-xs-6 col-sm-6 col-md-6 middlebox">
<p id="middletext"><strong></strong><br></p>
</div>
</div>
</div>
and here is the corresponding CSS:
.col-xs-3{
height: 33vh;
margin-bottom: 3vh;
padding: 0;
border: 2px solid black;
}
.col-xs-3.resume{
margin-top: 3vh;
}
.col-xs-3.websites{
height: 60vh;
margin-top: 3vh;
}
.col-xs-6{
height: 33vh;
margin-bottom: 3vh;
padding: 0px;
border: 2px solid black;
}
.col-xs-6.about{
margin-top: 3vh;
}
Another option for this sort of no-gaps layout is to use something like Masonry, although it's probably overkill if your actual layout is as simple as your example.
One way that I can think of is to use one div as parent for the first 2 columns:
html:
<div class="container">
<div class="row">
<div class="col-xs-9 col-sm-9 col-sm-9" >
<div class="col-xs-8 col-sm-8 col-md-8 about">
<img >
</div>
<div class="col-xs-4 col-sm-4 col-md-4 resume">
<img >
</div>
<div class="col-xs-4 col-sm-4 col-md-4 waterfall">
<img >
</div>
<div class="col-xs-8 col-sm-8 col-md-8 middlebox">
<p id="middletext"><strong></strong><br></p>
</div>
</div>
<div class="col-xs-3 col-sm-3 col-md-3 websites">
<img >
</div>
</div>
</div>
css
.col-xs-4{
height: 33vh;
margin-bottom: 3vh;
padding: 0;
border: 2px solid black;
}
.resume{
margin-top: 3vh;
}
.websites{
height: 68vh;
margin-top: 3vh;
border: 2px solid black;
}
.col-xs-8{
height: 33vh;
margin-bottom: 3vh;
padding: 0px;
border: 2px solid black;
}
.col-xs-8.about{
margin-top: 3vh;
}