Bootstrap - aligning figures with col-sm-4 command - html

I am trying to align horizontaly three elements using the col-sm-4 function but for whatever reason I am missing it is not working. No matter what I do, the items are still displayed aligned to left and vertically. The images are all the same size.
Here's the code snippet:
<section class="container">
<div class="row">
<figure class="col-sm-4">
<p text-align: center>PLAY</p>
<img src="img/m1.jpg"/>
</figure>
<figure class="col-sm-4">
<p text-align: center>LEARN</p>
<img src="img/m2.jpg"/>
</figure>
<figure class="col-sm-4">
<p text-align: center>HELP</p>
<img src="img/m3.jpg"/>
</figure>
</div>
</section>
and the css:
section .row img {
margin: 0 0 30px;
width: 100%;
border: 4px dotted #000;
clear: none;
}
It puzzles me because I have looked over other websites using the same technique and I cannot spot the error. Thanks.

you want like this ?
section .row img {
border: 4px dotted #000;
clear: none;
display:inline-block;
}
.col-sm-4
{
display:inline-block;
}
DEMO HERE

After making a few adjustments, I managed to get your code working (see comments in snippet for details)
/* made the boxes use flexible boxes to lay themselves out in a row */
.flexgrid {
display: flex;
flex-direction: row;
align-items: center;
}
/* fixed css because there were no 'row' elemeents */
/* added the > operand */
section > .col > img {
margin: 30px 0 30px;
width: 50%;
border: 4px dotted #000;
clear: none;
align: center;
}
.col > div, .col > img {
content-align: center
}
<section class="container">
<div class="flexgrid">
<figure class="col">
<!-- change <p> to <div> to avoid newline -->
<div>PLAY</div>
<center>
<img src="img/m1.jpg" />
</center>
</figure>
<figure class="col">
<div>LEARN</div>
<center>
<img src="img/m2.jpg" />
</center>
</figure>
<figure class="col">
<div>HELP</div>
<center>
<img src="img/m3.jpg" />
</center>
</figure>
</div>
</section>

Seems to be an issue with the screen size your using not being specified in the col-- format. I've added col-lg-4 col-md-4 col-sm-4 col-xs-4 as the class to support all screen sizes and it is working perfectly now.
section .row img {
margin: 0 0 30px;
width: 100%;
border: 4px dotted #000;
clear: none;
}
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script>
<link href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css" rel="stylesheet"/>
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/js/bootstrap.min.js"></script>
<section class="container">
<div class="row">
<figure class="col-lg-4 col-md-4 col-sm-4 col-xs-4">
<p text-align: center>PLAY</p>
<img src="img/m1.jpg"/>
</figure>
<figure class="col-lg-4 col-md-4 col-sm-4 col-xs-4">
<p text-align: center>LEARN</p>
<img src="img/m2.jpg"/>
</figure>
<figure class="col-lg-4 col-md-4 col-sm-4 col-xs-4">
<p text-align: center>HELP</p>
<img src="img/m3.jpg"/>
</figure>
</div>
</section>

You just need to use predefined bootstrap class text-center for <div class=row...:
section .row img {
margin: 0 0 30px;
width: 100%;
border: 4px dotted #000;
clear: none;
}
<link href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css" rel="stylesheet"/>
<section class="container">
<div class="row text-center">
<figure class="col-xs-4">
<p text-align: center>PLAY</p>
<img src="img/m1.jpg"/>
</figure>
<figure class="col-xs-4">
<p text-align: center>LEARN</p>
<img src="img/m2.jpg"/>
</figure>
<figure class="col-xs-4">
<p text-align: center>HELP</p>
<img src="img/m3.jpg"/>
</figure>
</div>
</section>

Related

Bootstrap 4 grid working for computer screens: resizes on browser resizing. Not resizing for phone screens (remains at medium screen setting)

I am making a page with one .html file and one .css file.
I have incorporated the bootstrap 4 CDN into my html head.
The grid appears properly for the medium screen sizes but it is not resizing when I view on my phone.
I have used bootstrap 4 before with no issues in my react app but the same methods do not seem to be working with plain html and css.
my code can be seen below.
html:
<html>
<head>
<link rel="stylesheet" type="text/css" href="style.css">
<title>Portfolio</title>
<meta name="description" content="Showcasing my portfolio">
<!-- Latest compiled and minified CSS (bootstrap) -->
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0/css/bootstrap.min.css" integrity="sha384-Gn5384xqQ1aoWXA+058RXPxPg6fy4IWvTNh0E263XmFcJlSAwiGgFAW/dAiS6JXm" crossorigin="anonymous">
</head>
<body>
<nav>
<div class="navLeft">
NAME
</div>
<div class="navRight">
PORTFOLIO
ABOUT
CONTACT
CURRICULUM VITAE
GITHUB PROFILE
</div>
</nav>
<div class="container">
<div class="contentPane">
<div class="nameSection">
<div class="row">
<div class="col-md-4 col-10 mx-auto">
<img src="" alt="NAME">
<h1>NAME</h1>
</div>
</div>
<div class="row">
<div class="col-md-4 col-10 mx-auto">
<div class="underline" class="col-12 mx-auto"></div>
<h4>Front End Developer</h4>
</div>
</div>
</div>
<div class="portfolioSection">
<div class="row">
<div class="col-4 mx-auto">
<h1>PORTFOLIO</h1>
</div>
</div>
<div class="row">
<div class="col-4 mx-auto">
<div class="underline" class="col-12 mx-auto"></div>
<h4>Front End Developer</h4>
</div>
</div>
<div class="row">
<div class="col-10 mx-auto">
<img class="screen" id="kovScreen" src="" alt="King Of Vape Screenshot">
</div>
<div class="col-md-5 col-10 mx-auto">
<img class="screen" id="rgbyScreen" src="" alt="Simon Game Screenshot">
testcontent
</div>
<div class="col-md-5 col-10 mx-auto">
<img class="screen" id="osxsScreen" src="" alt="Naughts and Crosses Screenshot">
testcontent
</div>
<div class="col-md-5 col-10 mx-auto">
<img class="screen" id="pomodoroScreen" src="" alt="Pomodoro Clock Screenshot">
testcontent
</div>
<div class="col-md-5 col-10 mx-auto">
<img class="screen" id="calculatorScreen" src="" alt="Calculator Screenshot">
testcontent
</div>
</div>
</div>
<div class="aboutSection">
<div class="row">
<div class="col-4 mx-auto">
<h1>PORTFOLIO</h1>
</div>
</div>
<div class="row">
<div class="col-4 mx-auto">
<div class="underline" class="col-12 mx-auto"></div>
<h4>Front End Developer</h4>
</div>
</div>
</div>
</div>
</div>
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0/js/bootstrap.min.js" integrity="sha384-JZR6Spejh4U02d8jOt6vLEHfe/JQGiRRSQQxSfFWpi1MquVdAyjUar5+76PVCmYl" crossorigin="anonymous"></script>
</body>
</html>
I do have more than 12 columns in some rows but never had an issue with it before, and as I stated earlier, everything works fine on medium screen sizes.
css:
nav {
position: fixed;
top: 0px;
z-index: 1;
display: block;
height: 50px;
width: 100%;
background-color: #A65900;
padding-top: 10px;
box-shadow: 0px 0px 10px 2px rgba(0, 0, 0, 0.68);
}
nav a {
text-decoration: none;
color: white;
padding: 0 0.5em;
display: inline;
}
nav .navLeft {
font-size: 20px;
display: inline;
margin-left: 5rem;
}
nav .navRight {
display: inline;
margin-right: 5rem;
}
.contentPane {
box-shadow: 0px 0px 10px 2px rgba(0, 0, 0, 0.68);
}
.nameSection {
width: 100%;
text-align: center;
background-color: #FFA200;
}
.nameSection img {
margin-top: 90px;
max-height: 200px;
width: 100%;
}
.underline {
display: block;
clear: both;
height: 8px;
background-color: white;
border-radius: 5px;
margin-bottom: 5px;
}
.nameSection h4 {
margin-bottom: 40px;
}
.portfolioSection {
text-align: center;
background-color: #FFEF00;
}
.portfolioSection h1 {
margin-top: 40px;
}
.screen {
width: 100%;
max-height: 200px;
}
Can anybody see what I am doing wrong?
All help is appreciated. Thanks.
See Responsive meta tag in the Bootstrap documentation.
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
You missed out the meta viewport directive so mobile browsers will assume you have not designed a responsive website and will default to scaling for a desktop design instead.
Add the meta element.

How to vertically align the items in the div?

.features {
background-color: #0375b4;
padding: 40px 100px;
float: left;
width: 100%;
}
.features img {
width: 100px;
}
.features-content {
text-align: center;
}
.features-content h1 {
font-size: 24px;
color: #ffffff;
text-transform: uppercase;
margin-top: 10px;
}
<link href="https://cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap/3.3.7/css/bootstrap.min.css" rel="stylesheet" />
<div class="features">
<div class="container">
<div class="row">
<div class="col-sm-4">
<div class="features-content">
<img src="https://image.flaticon.com/teams/slug/freepik.jpg" alt="Compass Logo">
<h1>Adventure</h1>
</div>
</div>
<div class="col-sm-4">
<div class="features-content">
<img src="https://image.flaticon.com/teams/slug/freepik.jpg" alt="Compass Logo">
<h1>Fun & Safety</h1>
</div>
</div>
<div class="col-sm-4">
<div class="features-content">
<img src="https://image.flaticon.com/teams/slug/freepik.jpg" alt="Compass Logo">
<h1>Impeccable Service</h1>
</div>
</div>
</div>
</div>
</div>
The items in the div are not vertically aligned . How do I properly align the items in the middle of the div? The picture in the last div is smaller than the pictures in other div so it has gone up. how to put all the pictures in the middle?
This can be achieved by specifying the desired image height (that of the other two images) to the img dom element.
In this case, we apply the following CSS rules to .features-content img
.features-content img {
object-fit: none;
width: 100%;
height: 150px;
}
Complete example
.features {
background-color: #0375b4;
padding: 40px 100px;
float: left;
width: 100%;
}
.features img {
width: auto;
}
.features-content {
text-align: center;
}
.features-content h1 {
font-size: 24px;
color: #ffffff;
text-transform: uppercase;
margin-top: 10px;
}
.features-content img {
object-fit: none;
width: 100%;
height: 150px;
}
<!-- Latest compiled and minified Bootstrap CSS -->
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css" integrity="sha384-BVYiiSIFeK1dGmJRAkycuHAHRg32OmUcww7on3RYdg4Va+PmSTsz/K68vbdEjh4u" crossorigin="anonymous">
<div class="features">
<div class="container">
<div class="row">
<div class="col-md-4">
<div class="features-content">
<img src="http://via.placeholder.com/150x150" alt="Compass Logo">
<h1>Adventure</h1>
</div>
</div>
<div class="col-md-4">
<div class="features-content">
<img src="http://via.placeholder.com/150x150" alt="Compass Logo">
<h1>Fun & Safety</h1>
</div>
</div>
<div class="col-md-4">
<div class="features-content">
<img src="http://via.placeholder.com/150x100" alt="Compass Logo">
<h1>Impeccable Service</h1>
</div>
</div>
</div>
</div>
</div>
Click the full screen button on the upper-right portion of the code snippet in order to see a wider view with items side-by-side; as shown in your example screenshot.
you can use following css property -
vertical-align: middle;
You can check in detail on here
Add vertical-align for images, and margin:0 auto; for div container.
.features{
background-color: #0375b4;
padding:40px 100px;
float: left;
width: 100%;
}
img{
width: auto;
vertical-align:middle;
}
.features-content{
text-align: center;
width:100%;
display:inline-block;
margin:0 auto;
}
.features-content h1{
font-size:12px;
margin:0;
text-transform: uppercase;
}
<div class="container">
<div class="row">
<div class="col-md-4">
<div class="features-content">
<img src="images/compass.png" alt="Compass Logo">
<h1>Adventure</h1>
</div>
</div>
<div class="col-md-4">
<div class="features-content">
<img src="images/tube.png" alt="Compass Logo">
<h1>Fun & Safety</h1>
</div>
</div>
<div class="col-md-4">
<div class="features-content">
<img src="images/diamond.png" alt="Compass Logo">
<h1>Impeccable Service</h1>
</div>
</div>
</div>
</div>
If you are using Bootstrap 4 just add d-flex align-items-center to row class to align vertically center.
In your case,
the third column h1 text length is grater when compare to other two so there is some issue in the design.
features{
background-color: #0375b4;
padding:40px 100px;
float: left;
width: 100%;
}
.features img{
width: auto;
}
.features-content{
text-align: center;
}
.features-content h1{
font-size: 24px;
color: #000;
text-transform: uppercase;
margin-top: 10px;
}
<link href="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0-beta.2/css/bootstrap.min.css" rel="stylesheet"/>
<div class="features">
<div class="container">
<div class="row d-flex align-items-center">
<div class="col-md-4">
<div class="features-content">
<img src="https://dummyimage.com/70x70/000/fff" alt="Compass Logo">
<h1>Adventure</h1>
</div>
</div>
<div class="col-md-4">
<div class="features-content">
<img src="https://dummyimage.com/70x70/000/fff" alt="Compass Logo">
<h1>Fun & Safety</h1>
</div>
</div>
<div class="col-md-4">
<div class="features-content">
<img src="https://dummyimage.com/70x70/000/fff" alt="Compass Logo">
<h1>Impeccable Service</h1>
</div>
</div>
</div>
</div>
</div>

Align images on one line css

I'm using bootstrap to design a site and I'm trying to align images horizontally and hiding the overflow.
Here's the div
<div class="timeline-gallery col-md-12" style="display: inline-block;">
<img src="/media/cache/de/0f/de0fca4d8b894f36a82a343cd150fcb9.jpg" class="img-thumbnail">
<img src="/media/cache/93/46/9346e937935238a5781beba426a279a1.jpg" class="img-thumbnail">
<img src="/media/cache/a2/53/a2531798d757427e8d5c625d1dfc34bc.jpg" class="img-thumbnail">
</div>
and the css for the images
.timeline-gallery img {
display: inline-block;
position: relative;
float: left;
margin-right: 5px;
overflow: hidden;
}
They occupy the space I'd like but instead are arranged like below
It's hard to understand what do You want ...
<div class="timeline-gallery col-md-12">
<div class='col-md-4'>
<img src="/media/cache/de/0f/de0fca4d8b894f36a82a343cd150fcb9.jpg" class="img-thumbnail">
</div>
<div class='col-md-4'>
<img src="/media/cache/93/46/9346e937935238a5781beba426a279a1.jpg" class="img-thumbnail">
</div>
<div class='col-md-4'>
<img src="/media/cache/a2/53/a2531798d757427e8d5c625d1dfc34bc.jpg" class="img-thumbnail">
</div>
</div>
Remove style='display:inline-block;' from bootstrap column col-md-12. Then add col-md-4 as image container, and CSS for image:
.timeline-gallery img {
max-width:100%;
height:auto;
margin:0 auto;
}
But I'm not sure what do You want...
Here you go with the solution https://jsfiddle.net/forj72t6/1/
.timeline-gallery img {
display:block;
position: relative;
margin-right: 5px;
overflow: hidden;
margin: 0 auto;
}
<link href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css" rel="stylesheet"/>
<div class="coantiner-fluid">
<div class="row">
<div class="timeline-gallery col-md-12">
<img src="https://encrypted-tbn0.gstatic.com/images?q=tbn:ANd9GcST7YDjHjnP5DURcPrZpcFPO6BI6I4kOiqTvNeCy4NRYFbA--5J" class="img-thumbnail">
<img src="https://encrypted-tbn0.gstatic.com/images?q=tbn:ANd9GcST7YDjHjnP5DURcPrZpcFPO6BI6I4kOiqTvNeCy4NRYFbA--5J" class="img-thumbnail">
<img src="https://encrypted-tbn0.gstatic.com/images?q=tbn:ANd9GcST7YDjHjnP5DURcPrZpcFPO6BI6I4kOiqTvNeCy4NRYFbA--5J" class="img-thumbnail">
</div>
</div>
</div>
I guess this is what you are looking for.

horizontally center multiple divs within a div in small devices (xs)

My page has 3 div(s) within a div. In tablet and desktop screens they look good (center-aligned), but on a very small device such as cellphone the inner div(s) are left aligned (I want them to be horizontally center aligned). I applied text-center, and center-block to the outer div but it does not work. Any suggestion? Here are the html, and css codes.
.img-responsive {
display: block;
max-width: 100%;
height: auto;
}
portfolio-caption {
max-width: 281px;
background-color: #994ACC;
text-align: center;
padding: 10px;
border-top: 3px solid #ffffff;
margin-bottom: 10px;
}
<div class="row">
<div class="col-md-4 col-sm-6 col-xs-12">
<div style="max-width: 281px">
<a href="#" ">
<img src="./x/pilotproject1.jpg " class="img-responsive " style="margin: 0 auto; " alt=" ">
</a>
<div class="portfolio-caption text-center ">
<strong><h4>Project Name</h4></strong>
</div>
</div>
</div>
<div class="col-md-4 col-sm-6 col-xs-12 ">
<div style="max-width: 281px ">
<a href="# ">
<img src="./x/pilotproject2.jpg " class="img-responsive "
style="margin: 0 auto; " alt=" ">
</a>
<div class="portfolio-caption text-center ">
<strong><h4>Project Name</h4></strong>
</div>
</div>
</div>
<div class="col-md-4 col-sm-6 col-xs-12 ">
<div style="max-width: 281px ">
<a href="# " class="pilot-link ">
<img src="./x/pilotproject3.jpg " class="img-responsive "
style="margin: 0 auto; " alt=" ">
</a>
<div class="portfolio-caption text-center ">
<strong><h4>Project Name</h4></strong>
</div>
</div>
</div>
</div>
The reason that I have is that the width of the pictures is 281 px, if I do not set the width, the width of the div that comes after the img will be bigger than 281 px which is not something that I want.
as you can see in this picture, the images are all left-aligned
I added a class centered as a container to center elements (please remove the border border: 1px solid red; it is used to show you the container block ):
.centered {
display: flex;
align-items: center;
justify-content: center;
width: 100%;
border: 1px solid red;
}
.img-responsive {
display: block;
max-width: 281px !important;
height: auto;
margin: 0 auto;
}
wrap each element you want to be centered.
Also in your css portfolio-caption should be .portfolio-caption to select a class.
I moved your in-line style to css class img-responsive so you can update your style in one place.
.img-responsive {
display: block;
max-width: 281px !important;
height: auto;
margin: 0 auto;
}
.portfolio-caption {
width: 281px;
background-color: #994ACC;
text-align: center;
padding: 10px;
border-top: 3px solid #ffffff;
margin-bottom: 10px;
float: right;
}
.centered {
display: flex;
align-items: center;
justify-content: center;
width: 100%;
/* border: 1px solid red; */
}
<link href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css" rel="stylesheet"/>
<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>
<div class="row">
<div class="col-md-4 col-sm-6 col-xs-12">
<div class="centered">
<a href="#">
<img src="http://placehold.it/350x150" class="img-responsive" alt=" ">
</a>
</div>
<div class="centered">
<div class="portfolio-caption text-center ">
<strong><h4>Project Name</h4></strong>
</div>
</div>
</div>
<div class="col-md-4 col-sm-6 col-xs-12">
<div class="centered">
<a href="# ">
<img src="http://placehold.it/350x150" class="img-responsive" alt=" ">
</a>
</div>
<div class="centered">
<div class="portfolio-caption">
<strong><h4>Project Name</h4></strong>
</div>
</div>
</div>
<div class="col-md-4 col-sm-6 col-xs-12">
<div class="centered">
<a href="# " class="pilot-link ">
<img src="http://placehold.it/350x150" class="img-responsive" alt=" ">
</a>
</div>
<div class="centered">
<div class="portfolio-caption text-center ">
<strong><h4>Project Name</h4></strong>
</div>
</div>
</div>
</div>
You should not apply classes to outer divs, apply them exactly to what you want to be centered : class="img-responsive center-block", and
also check the bootstrap version center-block is new in Bootstrap version 3.0.1 i believe.
Use
Text align : center ;
text-align:center
<div style="max-width: 281px; text-align : center">
Plunker link :
https://plnkr.co/edit/UaW436KiylzfqOCU1cg1?p=preview

Flexbox in Firefox

I have been building a site and have been experimenting with display:flexand had some success in implementing what I feel is a nice enough thumb-nail block element.
However, in Firefox it does this:
I have tested it and it seems to be an issue with the use of display:flex and position:absolute.
I have read that Firefox treats absolute positioning differently than others browsers I have tested in.
Chrome
Edge
Opera
I have experienced a similar issue in:
Internet Explorer 11
Safari 5.1.7
Firefox 50.1.0
HTML
<section id="services" class="text-center center-block">
<div class="container">
<div class="row">
<!-- Block -->
<div class="col-xs-12 col-sm-6 col-lg-4">
<div class="thumbnail grey mb-30">
<img src="img/picto/originals/png/Pound/Newable_Pictogram_CoolGrey_POUND.png" width="156" height="200" alt="" />
<div class="caption">
<p class="bold">Attractive commissions for business introductions, paid promptly.</p>
</div>
</div>
</div>
<!-- Block -->
<!-- Block -->
<div class="col-xs-12 col-sm-6 col-lg-4">
<div class="thumbnail grey mb-30">
<img src="img/picto/originals/png/Arrows/Newable_Pictogram_Navy_ARROWS.png" width="200" height="199" alt="" />
<div class="caption">
<p class="bold">We’re committed to delivering fast, and treating you and your clients fairly.</p>
</div>
</div>
</div>
<!-- Block -->
<!-- Block -->
<div class="col-xs-12 col-sm-6 col-lg-4">
<div class="thumbnail grey mb-30">
<img src="img/picto/new/Newable_Pictogram_Navy_GROWTH.png" width="271" height="200" alt="" />
<div class="caption">
<p class="bold">We are a trusted, long established and large-scale Responsible Finance Provider.</p>
</div>
</div>
</div>
<!-- Block -->
<!-- Block -->
<div class="col-xs-12 col-sm-6 col-lg-4">
<div class="thumbnail grey mb-30">
<img src="img/picto/new/Newable_Pictogram_cool_grey_PARTNER.png" width="200" height="200" alt="" />
<div class="caption">
<p class="bold">Incentive-led schemes to promote long term business development partnership.</p>
</div>
</div>
</div>
<!-- Block -->
<!-- Block -->
<div class="col-xs-12 col-sm-6 col-lg-4">
<div class="thumbnail grey">
<img src="img/picto/originals/png/Speech Bubbles/Newable_Pictogram_CoolGrey_SPEECHBUBBLES.png" width="263" height="200" alt="" />
<div class="caption">
<p class="bold">Best in class broker support package including dedicated account manager.</p>
</div>
</div>
</div>
<!-- Block -->
<!-- Block -->
<div class="col-xs-12 col-sm-6 col-lg-4">
<div class="thumbnail grey">
<img src="img/picto/originals/png/Infinity/Newable_Pictogram_Navy_INFINITY.png" width="215" height="100" alt="" />
<div class="caption">
<p class="bold">We partner with finance brokers, financial advisors, High Street banks, solicitors and accountants.</p>
</div>
</div>
</div>
<!-- Block -->
</div>
</div>
</section>
CSS
.thumbnail {
border: none;
min-height: 500px;
position: relative;
display: -webkit-flex;
display: flex;
justify-content: center;
align-items: center;
}
.thumbnail img {
padding-top: 0;
max-height: 50%;
max-width: 50%;
padding-bottom: 25%;
}
.caption {
position: absolute;
bottom: 0;
}
Am I just using display:flex incorrectly?
Check this basic example of your scenario (commented .caption padding just to make it clearer):
Added flex-flow: column wrap; to .thumbnail.
div.thumbnail {
border: none;
min-height: 500px;
position: relative;
display: -webkit-flex;
display: flex;
flex-flow: column wrap;
justify-content: center;
align-items: center;
}
.thumbnail img {
padding-top: 0;
max-height: 50%;
max-width: 50%;
/* padding-bottom: 25%; */
}
.caption {
/* position: absolute; */
/* bottom: 0; */
max-width: 50%;
margin: 0 auto;
}
<link href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css" rel="stylesheet" />
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.1.1/jquery.min.js"></script>
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/js/bootstrap.min.js"></script>
<section id="services" class="text-center center-block">
<div class="container">
<div class="row">
<!-- Block -->
<div class="col-xs-12 col-sm-6 col-lg-4">
<div class="thumbnail grey mb-30">
<img src="http://placehold.it/300x300" width="156" height="200" alt="" />
<div class="caption">
<p class="bold">Attractive commissions for business introductions, paid promptly.</p>
</div>
</div>
</div>
</div>
</div>
</section>