I am trying to design my company's website. But all images in the customer section are stacked vertically on mobile devices. I am using Bootstrap 5.2. I have tried col-xs and col-md classes but was not able to achieve the output. I am attaching the code and image. Thanks For the Help.
/*
===========================================
Customer Section
===========================================
*/
.dot {
height: 20px;
width: 20px;
background-color: #3736b0;
border-radius: 50%;
display: block;
position: absolute;
top: 105rem;
left: 50%;
}
.section-4-title {
display: block;
position: absolute;
top: 108rem;
}
.section-4 {
margin-top: 3rem;
}
.card {
overflow: hidden;
height: 4rem;
width: 7rem;
border: none;
margin-top: 3rem;
margin-bottom: 1rem;
box-shadow: 1px 1px 12px 0 rgba(0, 0, 0, 0.2);
}
.card img {
height: 100%;
width: 100%;
}
.card-3 {
overflow: hidden;
height: 4rem;
width: 8rem;
border: none;
box-shadow: 1px 1px 12px 0 rgba(0, 0, 0, 0.2);
}
<!--
===========================================
Customer Logo Section
===========================================
-->
<div class="container">
<section class="section-4">
<div class="container text-center">
<div class="row">
<div class="col-lg-12 col-md-12">
<div class="dot"></div>
</div>
</div>
<div class="row">
<h2 class="section-4-title">
Simplifying communications for Industry
<div class="title-highlighter">Leaders in India and World</div>
</h2>
</div>
<div class="container">
<!-- Customer Row 1 -->
<div class="row bg-primary">
<div class="bg-dark col-lg-2 col-sm-4 col-xs-6">
<div class="card">
<img src="svgs/logo-1.svg" class="img-fluid" alt="Logo 1" />
</div>
</div>
<div class="col-lg-2 col-sm-4 col-xs-6">
<div class="card">
<img src="svgs/logo-2.svg" class="img-fluid" alt="Logo 2" />
</div>
</div>
<div class="col-lg-2 col-sm-4 col-xs-6">
<div class="card card-3">
<img src="svgs/logo-3.svg" alt="Logo 3" />
</div>
</div>
<div class="col-lg-2 col-sm-4 col-xs-6">
<div class="card">
<img src="svgs/logo-4.svg" alt="Logo 4" />
</div>
</div>
<div class="col-lg-2 col-sm-4 col-xs-6">
<div class="card">
<img src="svgs/logo-5.svg" alt="Logo 5" />
</div>
</div>
<div class="col-lg-2 col-sm-4 col-xs-6">
<div class="card">
<img src="svgs/logo-6.svg" alt="Logo 6" />
</div>
</div>
</div>
<!-- Customer Row 2 -->
<div class="row">
<div class="col-lg-2 col-md-4 col-sm-6">
<div class="card">
<img
src="svgs/logo-7.svg"
class="card-img-top"
alt="Logo 7"
/>
</div>
</div>
<div class="col-lg-2 col-md-4 col-sm-6">
<div class="card">
<img
src="svgs/logo-8.svg"
class="card-img-top"
alt="Logo 8"
/>
</div>
</div>
<div class="col-lg-2 col-md-4 col-sm-6">
<div class="card card-3">
<img
src="svgs/logo-9.svg"
class="card-img-top"
alt="Logo 9"
/>
</div>
</div>
<div class="col-lg-2 col-md-4 col-sm-6">
<div class="card card-10 py-2">
<img
src="svgs/logo-10.svg"
class="card-img-top"
alt="Logo 10"
/>
</div>
</div>
<div class="col-lg-2 col-md-4 col-sm-6">
<div class="card card-3">
<img
src="svgs/logo-11.svg"
class="card-img-top"
alt="Logo 11"
/>
</div>
</div>
<div class="col-lg-2 col-md-4 col-sm-6">
<div class="card">
<img
src="svgs/logo-12.svg"
class="card-img-top"
alt="Logo 12"
/>
</div>
</div>
</div>
</div>
</div>
</section>
</div>
Related
How can I make a responsive div over a responsive image?
I developed this code, however div does not fully accompany the image.
Can anybody help me?
codePen
HTML
<div class="container-fluid first">
<div class="row tab-pane Galeria">
<div class="col-sm-2">
<a class="d-block mb-4 h-100">
<img class="Images img-fluid" src="https://source.unsplash.com/aob0ukAYfuI/400x300" alt="">
<div class="ImageText"> Name</div>
</a>
</div>
<div class="col-sm-2">
<a class="d-block mb-4 h-100">
<img class="Images img-fluid" src="https://source.unsplash.com/aob0ukAYfuI/400x300" alt="">
<div class="ImageText"> Name</div>
</a>
</div>
<div class="col-sm-2">
<a class="d-block mb-4 h-100">
<img class="Images img-fluid" src="https://source.unsplash.com/EUfxH-pze7s/400x300" alt="">
<div class="ImageText"> Name</div>
</a>
</div>
</div>
Can you please check out this code, we done minor modification in html and css, we also add some bootstrap classes for better view of the elements. Hope it will work for you.
.Galeria{
margin-top: 20px;
}
.image-item{
margin-bottom:20px;
}
.Images{
border-radius: .25rem;
width: 100%;
height: auto;
border-radius: 8px;
cursor: pointer;
}
.image-block{
position:relative;
}
.ImageText{
width: calc(100% - 20px);
height: auto;
background: #F0EDEB 0% 0% no-repeat padding-box;
border-radius: 8px 8px 0px 0px;
backdrop-filter: blur(25px);
-webkit-backdrop-filter: blur(50px);
position: absolute;
bottom: 0;
left: 10px;
padding: 10px;
box-sizing: border-box;
font-size: 16px;
font-family: "Segoe UI";
}
<link href="https://cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap/4.1.3/css/bootstrap.min.css" rel="stylesheet"/>
<div class="container-fluid first">
<div class="row tab-pane Galeria">
<div class="col-xl-2 col-lg-3 col-md-4 col-sm-6">
<div class="image-item">
<a class="d-block image-block h-100">
<img class="Images img-fluid" src="https://source.unsplash.com/aob0ukAYfuI/400x300" alt="">
<div class="ImageText"> Name</div>
</a>
</div>
</div>
<div class="col-xl-2 col-lg-3 col-md-4 col-sm-6">
<div class="image-item">
<a class="d-block image-block h-100">
<img class="Images img-fluid" src="https://source.unsplash.com/aob0ukAYfuI/400x300" alt="">
<div class="ImageText"> Name</div>
</a>
</div>
</div>
<div class="col-xl-2 col-lg-3 col-md-4 col-sm-6">
<div class="image-item">
<a class="d-block image-block h-100">
<img class="Images img-fluid" src="https://source.unsplash.com/EUfxH-pze7s/400x300" alt="">
<div class="ImageText"> Name</div>
</a>
</div>
</div>
<div class="col-xl-2 col-lg-3 col-md-4 col-sm-6">
<div class="image-item">
<a class="d-block image-block h-100">
<img class="Images img-fluid" src="https://source.unsplash.com/M185_qYH8vg/400x300" alt="">
<div class="ImageText"> Name</div>
</a>
</div>
</div>
<div class="col-xl-2 col-lg-3 col-md-4 col-sm-6">
<div class="image-item">
<a class="d-block image-block h-100">
<img class="Images img-fluid" src="https://source.unsplash.com/sesveuG_rNo/400x300" alt="">
<div class="ImageText"> Name</div>
</a>
</div>
</div>
<div class="col-xl-2 col-lg-3 col-md-4 col-sm-6">
<div class="image-item">
<a class="d-block image-block h-100">
<img class="Images img-fluid" src="https://source.unsplash.com/AvhMzHwiE_0/400x300" alt="">
<div class="ImageText"> Name</div>
</a>
</div>
</div>
</div>
</div>
Maybe you can replace img tag with div which has image set as background.
Something like this:
<div class="Images" style="background: url(https://source.unsplash.com/aob0ukAYfuI/400x300)">
<div class="ImageText"> Name</div>
</div>
.Images {
position: relative;
background-size: cover !important;
width: 90%;
height: 100%;
border-radius: 10px;
}
.ImageText {
...
width: calc(100% - 46px) !important;
}
You can use the below CSS:
.Galeria a {
position: relative;
}
.ImageText {
left: 0;
width: 100%;
box-sizing: border-box;
}
How can i center a jumbotron in the center of my page?
I already tried col-lg-6 with float-lg-center.
.jumbotron {
min-width: 585px;
margin: 10px auto;
display: flex;
justify-content: center;
margin: 10px 10px 10px 10px;
border: 0.08em solid black;
}
h1 {
font-size: 6em;
color: #484949;
}
#socDesc {
color: black;
}
body {
min-width: 520px;
}
<link href="//cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap/4.0.0-beta.2/css/bootstrap.css" rel="stylesheet" />
<div class="col-lg-8 col-md-10 col-sm-12 col-xs-12 offset-lg-2 offset-md-1 float-md-center">
<div class="jumbotron">
<div class="container">
<div class="container-fluid">
<div class="column">
<h1 class="text-center">Society</h1>
<hr />
<h4 class="text-center">"That's one small step for a man, one giant leap for mankind" - Neil Armstrong</h4>
<hr />
<div class="figure">
<div class="row">
<div class="col-lg-6 col-md-5 col-sm-4 col-xs-3">
<img id="" class="figure-img img-fluid rounded" src='http://4.bp.blogspot.com/-1tvR6wEiwiI/VYJSH4pfrsI/AAAAAAAABa8/RoQtTAtnD6Q/s1600/PBS.jpg' />
</div>
<div class="col-lg-6 col-md-5 col-sm-4 col-xs-3">
<img id="" class="figure-img img-fluid rounded" src='http://www.extremetech.com/wp-content/uploads/2013/04/lhc17.jpg' />
</div>
</div>
<!-- row-->
<figcaption class="figure-caption">This is the Large Ha</figcaption>
<hr />
</div>
<!-- figure -->
</div>
<!-- column -->
</div>
</div>
</div>
</div>
View on Codepen
Add text-center in the class
<div class="jumbotron text-center">
Try <div class="col-lg-6 col-md-6 col-sm-6 col-xs-6 offset-3 float-md-center"> That worked for me, but offset-xs-3 may be more proper due to the following:
It wasn't working in codepen for some reason but if you want the same amount of columns on all screen sizes you can use only col-xs-6 and it will apply that to all larger screen sizes.
i have problem in Bootstrap Thumbnails.
my thumbnails is like that:
img01. but want to be horizontal.
What am i doing ?
My Code:
HTML:
<div class="hrs" align="center">
<div class="row">
<div class="col-xs-6 col-lg-6 col-md-6 col-sm-6">
<div class="thumbnail">
<img src="img/AxMahsool.jpg" alt="AxMahsool01" class="img-responsive" />
<img src="img/AxMahsool.jpg" alt="AxMahsool02" class=" img-responsive" />
</div>
</div>
</div>
<div class="row">
<div class="col-xs-6 col-lg-6 col-md-6 col-sm-6">
<div class="thumbnail">
<img src="img/AxMahsool.jpg" alt="AxMahsool03" class=" img-responsive" />
<img src="img/AxMahsool.jpg" alt="AxMahsool04" class=" img-responsive" />
</div>
</div>
</div>
</div>
Css:
.hrs{
display: table;
margin: 0 auto;
padding: 20px;
color: white;
It's because you have them in separate <div class="row"> containers. What you should do is put all of your images in the same row container(so take out the second <div class="row">) -and/or- try adding this code to your CSS:
.thumbnail>img { display: inline-block; }
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.
Also, for my result text, on mobile is butted up against the left side of the screen with no space. I would like this lined up with the left side of the cards. But it's too far over on the left.
Here's my bootply:
http://www.bootply.com/EJO7TvV3B3
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;
}
Ok, this will not be a small answer but it could help you on your way understanding where you're problems are.
First of all i see some misuse of the Bootstrap code and wrappers:
You have one container <div class="container"> on the second line that wraps all of you're code. That works but it's not really the purpose of a container to wrap all of you're code. You allready have a wrapper <div class="content-section-c"> so why use a second one, or in you're example even a third one <div class="tabbable">?
When you use <div class="container"> you will be limited to the width of a container and that is maximum 1170px. So that is why you're having that much margin left and right of the navigation. Bootstrap have a class container-fluid <div class="container-fluid"> that takes the full width of the screen. So in you're example i would use that class for your navigation section
Fixing you're code with my comments above you could change the navigation to this:
<div class="content-section-c">
<div class="container-fluid">
<div class="row">
<div class="col-md-12">
<h2>Sample Search Results</h2>
<ul class="nav nav-tabs">
<li class="active">
APPLE<br>TREES
</li>
<li>
ORANGE<br>TREES
</li>
<li>
PEARS <br> TREES
</li>
<li>
BANANAS<br>
</li>
<li>
GRAPE<br> TREES
</li>
</ul>
</div>
</div>
</div>
Now the navigation bar is pulled to the left side, that is normal behaviour because you did not set any with to the ul and li so changing the css a bid will fix that to
.content-section-c {
padding: 50px 0;
background-color: #d4d4d4;
text-align: center;
}
.content-section-c ul {
width: 100%
}
.content-section-c ul li {
margin: 3%;
width: 14%;
}
To explain above css in detail, first of all you had a class .tabbable {text-align: center;} but we removed that wrapper (because you allready had one) Now you have to add that style text-align:center to the wrapper we kept content-section-c.
Give the ul a width of 100% so it takes all of the width.
You could give the li a width of 20%, because you use underlining of active list items the line underneath would actually take 20% and that's not really nice. So i did some css trick and added some margin on the list items.
Attention you will need to use some #media queries to drop that margin on smaller screens
That was actually the question you had isn't it? Still to give you some extra tips and information i can tell you this:
A bootstrap container is actually a container of row elements
and a bootstrap row is actually a container of columns col-*-*
Source: when-should-i-use-class-container-and-row
So if you look at the rest of you're code you could do something like this. Put every (column) group inside of a row.
<div class="tab-content">
<div class="container">
<div class="row">
<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>
And here you have a bootply with you're previous code cleaned up, good luck!
Bootply
I correct it. Hope you want like this.
/* CSS used here will be applied after bootstrap.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;
}
ul.nav{
width:100%;
}
.nav-tabs>li {
width: 20%;
}
<link href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/css/bootstrap.min.css" rel="stylesheet" integrity="sha384-1q8mTJOASx8j1Au+a5WDVnPi2lkFfwwEAa8hDDdjZlpLegxhjVME1fgjWPGmkzs7" crossorigin="anonymous">
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/js/bootstrap.min.js" integrity="sha384-0mSbJDEHialfmuBBQP6A4Qrprq5OVfW37PRR3j5ELqxss1yVqOtnepnHVP9aJ7xS" crossorigin="anonymous"></script>
<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 -->
I'm trying to create a series of Bootstrap coloumns to mimic a website design I've been given.
These columns have a blue border with the bottom of the div with a much thicker border.
A border is of little use as it alters the dimensions and available space so I tried to simply create a div within it to use background-color with width:100% but that doesn't seem to work either.
Can anyone show me the best way to go about this?
Thanks.
.featuredCatalog {
border-radius: 10px 10px 10px 10px;
-moz-border-radius: 10px 10px 10px 10px;
-webkit-border-radius: 10px 10px 10px 10px;
border: 5px solid #00AEF0;
}
.shopTab {
background-color: #00AEF0;
width: 100%;
min-height: 100%;
margin: 0;
}
<div class="row">
<div class="col-xs-6 col-sm-4 col-lg-2 featuredCatalog">
<img class="img-responsive" src="https://placehold.it/191x131">
<div class="shopTab">
<h4>Shop Now</h4>
</div>
</div>
<div class="col-xs-6 col-sm-4 col-lg-2 featuredCatalog">
<img class="img-responsive" src="https://placehold.it/191x131">
<h4>Shop Now</h4>
</div>
<div class="col-xs-6 col-sm-4 col-lg-2 featuredCatalog">
<img class="img-responsive" src="https://placehold.it/191x131">
<h4>Shop Now</h4>
</div>
<div class="col-xs-6 col-sm-4 col-lg-2 featuredCatalog">
<img class="img-responsive" src="https://placehold.it/191x131">
<h4>Shop Now</h4>
</div>
<div class="col-xs-6 col-sm-4 col-lg-2 featuredCatalog">
<img class="img-responsive" src="https://placehold.it/191x131">
<h4>Shop Now</h4>
</div>
</div>
Here is code snippet solves your issue and create product display like the image.
.shopTab {
position:absolute;
bottom:0;
background-color: #00AEF0;
width: 100%;
height: 26%;
}
.product-display {
position: relative;
border-radius: 10px;
border: 5px solid #00AEF0;
margin: 10px auto;
height: 160px;
max-width: 160px;
}
.product-display img{
display: block;
width: 100%;
height: 74%;
}
<link href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.5/css/bootstrap.min.css" rel="stylesheet"/>
<div class="row">
<div class="col-xs-6 col-sm-4 col-lg-2 featuredCatalog">
<div class="product-display">
<img class="img-responsive" src="https://placehold.it/191x131">
<div class="shopTab">
<h4>Shop Now</h4>
</div>
</div>
</div>
<div class="col-xs-6 col-sm-4 col-lg-2 featuredCatalog">
<div class="product-display">
<img class="img-responsive" src="https://placehold.it/191x131">
<div class="shopTab">
<h4>Shop Now</h4>
</div>
</div>
</div>
<div class="col-xs-6 col-sm-4 col-lg-2 featuredCatalog">
<div class="product-display">
<img class="img-responsive" src="https://placehold.it/191x131">
<div class="shopTab">
<h4>Shop Now</h4>
</div>
</div>
</div>
<div class="col-xs-6 col-sm-4 col-lg-2 featuredCatalog">
<div class="product-display">
<img class="img-responsive" src="https://placehold.it/191x131">
<div class="shopTab">
<h4>Shop Now</h4>
</div>
</div>
</div>
<div class="col-xs-6 col-sm-4 col-lg-2 featuredCatalog">
<div class="product-display">
<img class="img-responsive" src="https://placehold.it/191x131">
<div class="shopTab">
<h4>Shop Now</h4>
</div>
</div>
</div>
</div>