I have three Bootstrap thumbnails which vary in height because of their respective content. How am I able to make the bottom most element aligned with the bottom most element of all three of the thumbnails? So I want all of the buttons to align with the bottom most button.
Here is what I have so far:
<div class="container" id="section-6">
<div class="row">
<div class="col-sm-6 col-md-4">
<div class="thumbnail">
<img class="grayscale" alt="200x200" data-src="holder.js/200x200" src="http://www.blancocountycat.org/images/Ear-Tipped-Cat.jpg" data-holder-rendered="true">
<div class="caption text-center">
<h3>test</h3>
<p>The most popular front-end framework for developing responsive, mobile first projects on the web. The most popular front-end framework for developing responsive, mobile first projects on the web.</p> MEET OUR PEOPLE
</div>
</div>
</div>
<div class="col-sm-6 col-md-4">
<div class="thumbnail">
<img class="grayscale" alt="200x200" data-src="holder.js/200x200" src="http://www.hillspet.com/images/en-us/seniorCatBrainAging.jpg" data-holder-rendered="true">
<div class="caption text-center">
<h3>test</h3>
<p>The most popular front-end framework for developing responsive, mobile first projects on the web.</p> SUPPORT THE CAUSE
</div>
</div>
</div>
<div class="col-sm-6 col-md-4">
<div class="thumbnail">
<img class="grayscale" alt="200x200" data-src="holder.js/200x200" src="https://media4.giphy.com/media/mIPlgBgw9dgS4/200_s.gif" data-holder-rendered="true">
<div class="caption text-center">
<h3>Our History</h3>
<p>The most popular front-end framework for developing responsive, mobile firstework for developing responsive, mobile first projects on the web.</p> EXPLORE OUR HISTORY TIMELINE
</div>
</div>
</div>
</div>
</div>
Link to JSFiddle:
https://jsfiddle.net/obliviga/qze6g77g/
P.S. I would prefer the solution to work in IE8 or greater.
I just gave min and max height to <p> with overflow. See if this is suitable to you.
p.middle-text {
min-height: 130px;
max-height: 130px;
overflow: hidden;
}
https://www.xtendify.com/en/snippets/bootstrap/9-equal-column-height
This isn't the most ideal solution depending on how you plan on implementing your site over all as it needs to take into account any changes in the amount of text that will ultimately sit in the p tag above the href element. The margins will have to be adjusted in order for the links to remain aligned across the bottom. I added these classes to your second and third p blocks class="bottom-even-2nd" and class="bottom-even-3rd".
I also changed the col-sm-6 col-md-4 you have since Bootstap works across a 12 column grid otherwise the last block will be pushed below the second when the window is decreased.
Related
How can I adjust my 'card' so that it is displayed across the entire width of the screen?
I am using bootstrap
<div class="card">
<h4 style="margin-top: 5px; width: 100%;">{{$tipo->tipo }}</h4>
</div>
i need width similar to footer
If you are using the latest Bootstrap 4 then this code will create a card across the entire width:
<div class="card w-100 mt-2">
<h4>Restaurante</h4>
</div>
If there is still a gap then it is likely you have padding on the container div surrounding the card, so you would need to remove that.
the first thing you need to notice it's that card class display is flex in bootstrap.Also card-body has a 20px padding.So the first thing you need is use p-0 in card-body then devide your card body to multi row.So you below code:
<div class='card'>
<div class='card-img-top'>
<img src='...' />
</div>
<div class='card-body p-0'>
<div class='row mx-0'>
<div class='col-12 p-2'>
...card content
</div>
</div>
<div class='d-block px-0'>
<h4>Your footer</h4>
</div>
</div>
</div>
if you put a clear image to view what you want,I will help you more.I hope I could help you.
I am trying to create a Bootstrap grid layout with different images. Everything is fine except when viewing on different mobile devices in the mobile inspector on Chrome. Below is a picture of what it looks like in the inspector. The second image is slightly off-centered from the former image.
<section class="container" id="main">
<section class="center-block text-center">
<h4>Random Column Number 1</h4>
<img src="https://www.apple.com/ac/structured-data/images/open_graph_logo.png?201701231950" width="500px" height="262px"/>
</section>
<section class="col-lg-6 center-block text-center">
<h4>Random Column Number 2</h4>
<img src="http://www.appliste.cz/wp-content/uploads/2016/05/Apple_1998.png" width="500px" height="262px" />
</section>
<section class="col-lg-6 center-block text-center">
<h4>Random Column Number 3</h4>
<img src="https://upload.wikimedia.org/wikipedia/commons/thumb/8/84/Apple_Computer_Logo_rainbow.svg/931px-Apple_Computer_Logo_rainbow.svg.png" width="500px" height="262px" />
</section>
</section>
Here is the JSFiddle. The problem is that I am trying to off-set the second section as a "col-lg-6 center-block text-center" class. If I remove the col-lg-6 it works just fine. But I want to be able to stack two images next to each other. Is there any way to correct this so that it is centered like the first image? The JSFiddle contains three images.
This is what it looks like at full screen.
The images are not the correct aspect ratio because of the force width and height set. Perhaps just set a max-height so they image width can change responsively.
Also, center-block should be used on the images instead of the col-
<section class="container" id="main">
<section class="center-block text-center">
<h4>Random Column Number 1</h4>
<img src="https://www.apple.com/ac/structured-data/images/open_graph_logo.png?201701231950" class="center-block img-responsive" />
</section>
<section class="col-lg-6 text-center">
<h4>Random Column Number 2</h4>
<img src="http://www.appliste.cz/wp-content/uploads/2016/05/Apple_1998.png" class="center-block img-responsive" />
</section>
<section class="col-lg-6 center-block text-center">
<h4>Random Column Number 3</h4>
<img src="https://upload.wikimedia.org/wikipedia/commons/thumb/8/84/Apple_Computer_Logo_rainbow.svg/931px-Apple_Computer_Logo_rainbow.svg.png" class="center-block img-responsive" />
</section>
</section>
http://www.codeply.com/go/JBhTWnvfv5
Just add a media query when on mobile devices.
It would look something like this:
#media screen and (max-width: 720px) {
.center-block {
padding:0 !important;
}
}
Fiddle
<div class="col-sm-3">....</div>
....
use this code in your div where you are placing your grid and and div with these classes as i mentioned above. It works
Ok so I have the following HTML
<div class="container">
<div class="row col-sm-12" id="productBrief">
<div id="RaspberryAndChocolate" style="display:none; height:200px;">
<div class="col-sm-6 text-center">
<img src="~/Content/Images/YogurtImages_404x290/Rasberry_White_Chocolate_Yogurt.png" class="img-responsive" style="margin: 0 auto; padding-top: 5%" alt="Rasberry White Chocolate Yogurt" />
</div>
<div class="col-sm-6">
<h2 class="raspberryRed productLineHeight">FLAVOUR #3</h2>
<h1 class="raspberryRed">
RASPBERRY &<br /> WHITE CHOCOLATE
</h1>
<p class="productPara">
A decadent combination of whole raspberries and smooth white chocolate that you will want to make last as long as possible. Teaspoon recommended.
</p>
<p>
<span class="label label-danone label-as-badge" style="font-size: 0.9em; padding:3%">VIEW ALL FLAVOURS</span>
</p>
</div>
</div>
<div class="clearfix"></div>
<div id="BlueBerry" style="display:none; height:200px;">
<div class="col-sm-6 text-center">
<img src="~/Content/Images/YogurtImages_404x290/Blueberry_Yogurt.png" class="img-responsive" style="margin: 0 auto; padding-top: 5%" alt="Blueberry Yogurt" />
</div>
<div class="col-sm-6">
<h2 class="blueBerry productLineHeight">FLAVOUR #6</h2>
<h1 class="blueBerry">
BLUEBERRY
</h1>
<p class="productPara">
Just imagine plump and juicy blueberries immersed in a deliciously creamy yoghurt. Enough said.
</p>
<p>
<span class="label label-as-badge" style="font-size: 0.9em; padding:3%">VIEW ALL FLAVOURS</span>
</p>
</div>
</div>
<div class="clearfix"></div>
</div>
<div class="clearfix"></div>
<div class="row">
<div class="col-lg-12 text-center">
<div class="col-lg-2"></div>
<p style="width:70%;" class="text-center col-lg-8">
Experiencing Ultimate's uniquely luscious texture for the first time is beyond words. So don't even try. Take a moment to enjoy the ultra creaminess, the juicy ripened fruits and an array of wicked indulgences that come together to create a yoghurt like no other.
</p>
<div class="col-lg-2"></div>
</div>
</div>
Now there are roughly about 8 different divs but for simplicity I am only showing 2, but only one div is shown look at it as a random affect so the user refreshes the page a different div is shown (this is done in jquery) but if you look at the bottom of the HTML you will see another row with a P tag this is what is causing he issue, when displayed on a desktop it shows like this
when I minimize the browser the text at the bottom of the image displays under the text located to the right hand side of the yogurt box as shown here.
I have added the clearfix, tried adding a new container and yet the problem still remains....
You are using invalid bootstrap grid. Col should be a child of row. Use correct grid and everything will work perfectly.
Scott, hunzaboy says you need to use the dive like this
<div class="row">
<div class="col-sm-12"></div>
</div>
I don't fully understand your question, but hope you asking this,
when re-sizing your first image, I will suitably re-size without any harm to other divs. For that You need to devide that into 3 main divs, check the below code
<div class="row">
<div class="col-md-6">This is the image holding div</div><div class="col-md-6"> this is the right side text "Flavour #6, etc..."</div>
<div class="col-md-12">This is the text on the bottom</div>
</div>
I will look, 2 columns on the top and one column in the bottom.
For mobile view, you can use col-xs-12class, the it will show as stack.
Hope this is you asking. Thanks
So I'm trying to mimic some of the look of this website:
http://quay.com.au/
Since I'm intrigued by the design. I'm wondering how to go about overlapping containers in rows using Bootstrap, since I've looked into the code and it seems like that's what they're using.
This is what I have for HTML so far:
<div class="row">
<div class="col-md-5 col-md-offset-2"><div class="about img-rounded">
<h3>About</h3>
<p><b>Info1</b></p>
<p>Info2 </p>
</div></div>
</div>
<div class="row">
<div class="col-md-3 col-md-offset-1"></div>
<div class="col-md-3 col-md-offset-2"><div class="projects img-rounded">
<h3>Projects</h3>
<img class="img-responsive" src="img">
<p>Description</p>
<img class="img-responsive" src="img">
<p>Description</p>
<img class="img-responsive" src="img">
<p>Description</p>
</div>
</div>
<div class="row">
<div class="col-md-6 col-md-offset-3"><div class="work img-rounded">
<h3>Work</h3>
</div></div>
</div>
</div>
Any suggestions? Something to do with z-index in css is my only guess...
Looking at the code on the site the container has a position: relative and to get the sections overlapping the sections are offset from the top, like The Query Experience
.page-index .pattern-gray {
top: -240px;
}
quick bootply http://www.bootply.com/Blms3j1GjO
What you're looking for is called Parallax Scrolling. There are several tutorials out there, and a full implementation would be difficult to include in one answer here.
Here's a good resource from David Walsh on this
Basically, this is a combination of background-attachment: fixed and overlapping div elements, and some javascript to flop the selected image when it's hidden.
I hope that helps.
I am trying to use the Enigma theme on my WP site.
It allows you to add a logo about 200px wide which works with the responsiveness of the site.
However, I want to upload a much wider image, which then resizes as the screen gets smaller.
I added a class to the image file and tried to target it with css
max-width: 100%;
height: auto;
I am familiar with media queries but nothing I do is working.
Here is the theme, this is an example site, not the real site I am working on but it presents the same problem.
http://bestgirlsonearth.com
I've erased my work on it just to show the theme as is.
Due to fluid-system-column of bootstrap your image is located in a 6col "col-md-6" and by definition that class can't take more space or less than her parents middle weight (here row)
I'm not a user of Twitter Bootstrap but i think you should change in your header.php to have two rows and your full-sized img :
<div class="row ">
<div class="col-md-6 col-sm-12">
<div class="logo">
<a href="http://bestgirlsonearth.com/" title="Best Girls on Earth" rel="home">
<img src="http://bestgirlsonearth.com/wp-content/uploads/2014/10/bgeheader3.png" style="height:182px; width:1023px;">
</a>
<p>The finest women on the planet</p>
</div>
</div>
<div class="col-md-6 col-sm-12">
<ul class="head-contact-info">
//you contact info
</ul>
</div>
</div>
by this :
<div class="row ">
<div class="col-md-12 col-sm-12">
<div class="logo">
<a href="http://bestgirlsonearth.com/" title="Best Girls on Earth" rel="home">
<img src="http://bestgirlsonearth.com/wp-content/uploads/2014/10/bgeheader3.png" style="/* height:182px; */ /* width:1023px; */"></a>
<p>The finest women on the planet</p>
</div>
</div>
</div>
<div class="row">
<div class="col-md-12 col-sm-12">
<ul class="head-contact-info">
// Your contact infos
</ul>
</div>
</div>
cheers,