Align Quick View Buttons Horizontally/Vertically - css

how do I align the quick view buttons horizontally?
I've tried css below but it doesn't work. Please advise. Thank you.
.woosq-btn {
display: flex;
justify-content: center;
}
I'm using WPC Smart Quick View plugin. Link https://wordpress.org/plugins/woo-smart-quick-view/
UPDATE - 3 MAY 2021
After using the CSS provided by #Ali Klein, it triggered another problem. All products are shown horizontally.
I fixed it by adding flex-wrap: wrap;
ul.products {
display: flex;
flex-wrap: wrap;
}
li.product {
display: flex;
flex-direction: column;
}
li.product > a {
flex: 1;
}
Final outcome:

The way I'd approach this is by applying display: flex; flex-direction: column on the individual cards, then wrapping all the content apart from the Quick View button in a container (it's already in a container a.woocommerce-loop-product__link), and give that container flex: 1 so it fills up the space of the card vertically.
.container {
display: flex;
}
.item {
display: flex;
flex-direction: column;
flex: 1;
margin: 10px;
background: lightblue;
}
.content {
flex: 1;
}
.image {
width: 100%;
height: 200px;
background-color: darkblue;
}
.description {
padding: 10px;
}
.btn {
margin: 10px;
}
<div class="container">
<div class="item">
<div class="content">
<div class="image"></div>
<p class="description">Suspendisse interdum consectetur libero id faucibus nisl tincidunt eget. Vitae sapien pellentesque habitant morbi tristique. </p>
</div>
<button class="btn">
Quick View
</button>
</div>
<div class="item">
<div class="content">
<div class="image"></div>
<p class="description">Sit amet nisl purus in mollis nunc sed id.</p>
</div>
<button class="btn">
Quick View
</button>
</div>
<div class="item">
<div class="content">
<div class="image"></div>
<p class="description">Diam phasellus vestibulum lorem sed risus ultricies. Elementum integer enim neque volutpat.</p>
</div>
<button class="btn">
Quick View
</button>
</div>
<div class="item">
<div class="content">
<div class="image"></div>
<p class="description">Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua orci nulla pellentesque dignissim enim sit amet venenatis</p>
</div>
<button class="btn">
Quick View
</button>
</div>
</div>
With your markup, the css would look something like:
ul.products {
display: flex;
}
li.product {
display: flex;
flex-direction: column;
}
li.product > a {
flex: 1;
}
You'll end up with the following:

Related

CSS grid columns changing size with long content

I am building a stepper component using a CSS grid.
The grid has two rows and its column count is based on the number of steps in the stepper.
Each step has a header and a body.
Each step header lives in row 1 and takes exactly one column of the grid.
I've made each step header to be as big as its content and to stretch until it reaches the min-width of its siblings.
grid-template-columns: repeat(var(--steps-count), minmax(100px, auto));
The body of each step starts at row 2 and spans the number of columns in the first row, only the body of the selected step is visible, all others are hidden.
THE PROBLEM:
If the step body has short content the grid auto columns are working as expected, but if the body has a huge amount of content like in step 3 in example 1, all the columns in the grid look the same size, it's like the columns no longer respect the auto in the minmax() function and behave like they are all set to 1fr.
THE FIX:
The only fix I found is to explicitly set the width of the step body container to match the width of the entire stepper. I really want to avoid that, since the content of the step headers can be changed at runtime.
Example 1 - step with big body content
.stepper {
display: grid;
grid-template-columns: repeat(var(--steps-count), minmax(100px, auto));
row-gap: 8px;
font-family: "Roboto", sans-serif;
}
.step {
display: contents;
}
.step__header {
display: flex;
flex-direction: column;
align-items: center;
background: #000;
color: #fff;
padding: 8px;
gap: 8px;
cursor: pointer;
overflow: hidden;
border: 1px solid #fff;
}
.step__body {
display: none;
grid-row-start: 2;
grid-column: span var(--steps-count);
padding: 16px;
}
.step__content {
display: none;
}
.step__header-text {
width: 100%;
text-align: center;
}
.step__header-title {
text-overflow: ellipsis;
overflow: hidden;
white-space: nowrap;
}
.step__header-indicator {
display: flex;
align-items: center;
justify-content: center;
width: 24px;
height: 24px;
background: #fff;
border-radius: 12px;
}
.step__header-indicator::after {
content: "🍻";
}
.step--selected {
color: #fff;
}
.step--selected .step__header {
background: purple;
}
.step--selected .step__body {
display: block;
background: purple;
}
.step--selected .step__content {
display: block;
}
<div class="stepper" style="--steps-count: 4">
<div class="step" style="--step-index: 0">
<div class="step__header-wrapper">
<div class="step__header">
<div class="step__header-indicator"></div>
<div class="step__header-text">
<div class="step__header-title">Step 1</div>
</div>
</div>
</div>
<div class="step__body">
<div class="step__content">Step body 1</div>
</div>
</div>
<div class="step" style="--step-index: 1">
<div class="step__header-wrapper">
<div class="step__header">
<div class="step__header-indicator"></div>
<div class="step__header-text">
<div class="step__header-title">Step 2</div>
</div>
</div>
</div>
<div class="step__body">
<div class="step__content">Step body 2</div>
</div>
</div>
<div class="step step--selected" style="--step-index: 2">
<div class="step__header-wrapper">
<div class="step__header">
<div class="step__header-indicator"></div>
<div class="step__header-text">
<div class="step__header-title">
Lorem ipsum dolor sit amet, consectetur adipiscing elit.
</div>
</div>
</div>
</div>
<div class="step__body">
<div class="step__content">
<div>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Phasellus sapien arcu, imperdiet sed augue ut, rhoncus elementum urna. Orci varius natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus. Ut id ultricies libero, ac interdum
justo. Donec auctor quam in neque commodo, eget auctor turpis condimentum. Integer blandit urna vitae nisi bibendum luctus. Ut a laoreet purus, vel dictum nibh. Vestibulum non faucibus mi, eu tempor lectus. Mauris in varius lacus. Nullam pretium
at felis nec pharetra. Suspendisse dui ex, ullamcorper ac scelerisque ut, fermentum at urna. Aliquam efficitur, leo et egestas convallis, sapien tortor tincidunt velit, a faucibus ligula dui ac eros. Nunc sed sagittis orci. Fusce quam est, convallis
ac commodo eget, tincidunt non erat.</div>
</div>
</div>
</div>
<div class="step" style="--step-index: 3">
<div class="step__header-wrapper">
<div class="step__header">
<div class="step__header-indicator"></div>
<div class="step__header-text">
<div class="step__header-title">Step 4</div>
</div>
</div>
</div>
<div class="step__body">
<div class="step__content">Step body 4</div>
</div>
</div>
</div>
Example 2 - step with small body content
#charset "UTF-8";
.stepper {
display: grid;
grid-template-columns: repeat(var(--steps-count), minmax(100px, auto));
row-gap: 8px;
font-family: "Roboto", sans-serif;
}
.step {
display: contents;
}
.step__header {
display: flex;
flex-direction: column;
align-items: center;
background: #000;
color: #fff;
padding: 8px;
gap: 8px;
cursor: pointer;
overflow: hidden;
border: 1px solid #fff;
}
.step__body {
display: none;
grid-row-start: 2;
grid-column: span var(--steps-count);
padding: 16px;
}
.step__content {
display: none;
}
.step__header-text {
width: 100%;
text-align: center;
}
.step__header-title {
text-overflow: ellipsis;
overflow: hidden;
white-space: nowrap;
}
.step__header-indicator {
display: flex;
align-items: center;
justify-content: center;
width: 24px;
height: 24px;
background: #fff;
border-radius: 12px;
}
.step__header-indicator::after {
content: "🍻";
}
.step--selected {
color: #fff;
}
.step--selected .step__header {
background: purple;
}
.step--selected .step__body {
display: block;
background: purple;
}
.step--selected .step__content {
display: block;
}
<div class="stepper" style="--steps-count: 4">
<div class="step" style="--step-index: 0">
<div class="step__header-wrapper">
<div class="step__header">
<div class="step__header-indicator"></div>
<div class="step__header-text">
<div class="step__header-title">Step 1</div>
</div>
</div>
</div>
<div class="step__body">
<div class="step__content">Step body 1</div>
</div>
</div>
<div class="step" style="--step-index: 1">
<div class="step__header-wrapper">
<div class="step__header">
<div class="step__header-indicator"></div>
<div class="step__header-text">
<div class="step__header-title">Step 2</div>
</div>
</div>
</div>
<div class="step__body">
<div class="step__content">Step body 2</div>
</div>
</div>
<div class="step step--selected" style="--step-index: 2">
<div class="step__header-wrapper">
<div class="step__header">
<div class="step__header-indicator"></div>
<div class="step__header-text">
<div class="step__header-title">
Lorem ipsum dolor sit amet, consectetur adipiscing elit.
</div>
</div>
</div>
</div>
<div class="step__body">
<div class="step__content">
<div>step 3 short content</div>
</div>
</div>
</div>
<div class="step" style="--step-index: 3">
<div class="step__header-wrapper">
<div class="step__header">
<div class="step__header-indicator"></div>
<div class="step__header-text">
<div class="step__header-title">Step 4</div>
</div>
</div>
</div>
<div class="step__body">
<div class="step__content">Step body 4</div>
</div>
</div>
</div>
As #MichaelBenjamin said, it's related to the content of the body. When it exceed a certain size the calculation of the column size behave differently.
I will try to grab the detail of such calculation but a solution is to make sure the body doesn't contribute to the grid size calculation by using width:0;min-width:100%;
.stepper {
display: grid;
grid-template-columns: repeat(var(--steps-count), minmax(100px, auto));
row-gap: 8px;
font-family: "Roboto", sans-serif;
}
.step {
display: contents;
}
.step__header {
display: flex;
flex-direction: column;
align-items: center;
background: #000;
color: #fff;
padding: 8px;
gap: 8px;
cursor: pointer;
overflow: hidden;
border: 1px solid #fff;
}
.step__body {
display: none;
grid-row-start: 2;
grid-column: span var(--steps-count);
padding: 16px;
width: 0;
min-width: 100%;
box-sizing: border-box;
}
.step__content {
display: none;
}
.step__header-text {
width: 100%;
text-align: center;
}
.step__header-title {
text-overflow: ellipsis;
overflow: hidden;
white-space: nowrap;
}
.step__header-indicator {
display: flex;
align-items: center;
justify-content: center;
width: 24px;
height: 24px;
background: #fff;
border-radius: 12px;
}
.step__header-indicator::after {
content: "🍻";
}
.step--selected {
color: #fff;
}
.step--selected .step__header {
background: purple;
}
.step--selected .step__body {
display: block;
background: purple;
}
.step--selected .step__content {
display: block;
}
<div class="stepper" style="--steps-count: 4">
<div class="step" style="--step-index: 0">
<div class="step__header-wrapper">
<div class="step__header">
<div class="step__header-indicator"></div>
<div class="step__header-text">
<div class="step__header-title">Step 1</div>
</div>
</div>
</div>
<div class="step__body">
<div class="step__content">Step body 1</div>
</div>
</div>
<div class="step" style="--step-index: 1">
<div class="step__header-wrapper">
<div class="step__header">
<div class="step__header-indicator"></div>
<div class="step__header-text">
<div class="step__header-title">Step 2</div>
</div>
</div>
</div>
<div class="step__body">
<div class="step__content">Step body 2</div>
</div>
</div>
<div class="step step--selected" style="--step-index: 2">
<div class="step__header-wrapper">
<div class="step__header">
<div class="step__header-indicator"></div>
<div class="step__header-text">
<div class="step__header-title">
Lorem ipsum dolor sit amet, consectetur adipiscing elit.
</div>
</div>
</div>
</div>
<div class="step__body">
<div class="step__content">
<div>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Phasellus sapien arcu, imperdiet sed augue ut, rhoncus elementum urna. Orci varius natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus. Ut id ultricies libero, ac interdum
justo. Donec auctor quam in neque commodo, eget auctor turpis condimentum. Integer blandit urna vitae nisi bibendum luctus. Ut a laoreet purus, vel dictum nibh. Vestibulum non faucibus mi, eu tempor lectus. Mauris in varius lacus. Nullam pretium
at felis nec pharetra. Suspendisse dui ex, ullamcorper ac scelerisque ut, fermentum at urna. Aliquam efficitur, leo et egestas convallis, sapien tortor tincidunt velit, a faucibus ligula dui ac eros. Nunc sed sagittis orci. Fusce quam est, convallis
ac commodo eget, tincidunt non erat.</div>
</div>
</div>
</div>
<div class="step" style="--step-index: 3">
<div class="step__header-wrapper">
<div class="step__header">
<div class="step__header-indicator"></div>
<div class="step__header-text">
<div class="step__header-title">Step 4</div>
</div>
</div>
</div>
<div class="step__body">
<div class="step__content">Step body 4</div>
</div>
</div>
</div>
width:0 will disable the size contribution and min-width:100% will make sure that your content fill all the available space (defined by the other content)
Few observations:
The columns break when the body content wraps. It's not just "a huge amount content" causing the problem, it's the wrap.
The body of the stepper preserves the column width until the moment the content wraps. The columns then start shrinking, and continue to shrink as more content is added, until the columns reach equal width.
Like you said, they "behave like they are all set to 1fr".
The problem is the auto value in the minmax argument in grid-template-columns. For some reason (I don't have time to look into this at the moment), the auto value resizes the columns on wrap.
Perhaps switch from auto to min-content.
(I'll ping #TemaniAfif. Maybe he can help.)

css tables: how to display alternately first and last columns in a "abba" pattern on mobile?

I am new here.
I am banging my heads on the keyboard as I spent the last 2 hours trying to solve this problem:
ASSETS: I have a page where I list services using an image on the left, and text on the right. Except... the following service has text on the left and image on the right, so the page looks a little bit like a chequer board. IMAGE-TEXT / TEXT-IMAGE / IMAGE-TEXT.. you get the idea. I used tables to do that. one table and one row per service, two columns for each row.
This is great on desktop; the problem is that when on mobile, my trusty responsive tables act this way: they always put the left column on top of the right column, ignoring the content. The result is that I have IMAGE then TEXT than TEXT then IMAGE etc.., which is confusing when scrolling down on mobiles. We don't know what image relates to what because you would expect a different behaviour: you would want to see IMAGE, then TEXT, then IMAGE, then TEXT etc...
I haven't found any solution to this on the web, possibly because I can't synthesise properly my question in Google! So I thought I asked you. Please any comment and approach to this kind of problem is welcome!
Here's my CSS and HTML:
section-services {
display: table;
width: 100%;
min-height: 100%;
height: inherit;
}
.row-services {
display: table-row;
width: 100%;
height: 100%;
}
.col-left-services, .col-right-services {
display: table-cell;
width: 50%;
vertical-align: middle;
}
.col-left-services {
padding-right: 10px;
}
.col-right-services {
padding-left:10px;
}
.content-services {
}
#media all and (max-width: 800px){
section-services{
display:block;
width: 100%;
}
}
#media all and (max-width: 800px){
.row-services,
.col-left-services,
.col-right-services,
.col-left-services:before,
.col-right-services:before{
display:block;
width: 100%;
margin-left: auto;
margin-right: auto;
padding-top:10px;
padding-bottom:10px;
}
}
<section-services>
<div class="row-services">
<div class="col-left-services">
<div class="content-services">
<h2 style="text-align: center;">RED FERRARI</h2>
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Sed haec quidem liberius ab eo dicuntur et saepius. Plane idem, inquit, et maxima quidem, qua fieri nulla maior potest.
</div>
</div>
<div class="col-right-services">
<div class="content-services">
<img src="http://buyersguide.caranddriver.com/media/assets/submodel/6873.jpg" />
</div>
</div>
</div>
</section-services>
<section-services>
<div class="row-services">
<div class="col-left-services">
<div class="content-services">
<img src="http://buyersguide.caranddriver.com/media/assets/submodel/6866.jpg" />
</div>
</div>
<div class="col-right-services">
<div class="content-services">
<h2 style="text-align: center;">YELLOW FERRARI</h2>
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Sed haec quidem liberius ab eo dicuntur et saepius. Plane idem, inquit, et maxima quidem, qua fieri nulla maior potest.
</div>
</div>
</div>
</section-services>
My approach to this is to use display: flex.
Display your DIVs in flex mode and add a class to the second paragraph to force it to the top, like this:
section-services {
display: table;
width: 100%;
min-height: 100%;
height: inherit;
}
.row-services {
display: table-row;
width: 100%;
height: 100%;
}
.col-left-services, .col-right-services {
display: table-cell;
width: 50%;
vertical-align: middle;
}
.col-left-services {
padding-right: 10px;
}
.col-right-services {
padding-left:10px;
}
.content-services {
}
#media all and (max-width: 800px){
section-services{
display:block;
width: 100%;
}
}
#media all and (max-width: 800px){
.row-services,
.col-left-services,
.col-right-services,
.col-left-services:before,
.col-right-services:before {
display:flex;
-webkit-display:flex;
-moz-display:flex;
flex-direction: column;
-webkit-flex-direction: column;
-moz-flex-direction: column;
width: 100%;
margin-left: auto;
margin-right: auto;
padding-top:10px;
padding-bottom:10px;
}
.col-floated {
order: -1;
-webkit-order: -1;
-moz-order: -1;
}
}
<section-services>
<div class="row-services">
<div class="col-left-services">
<div class="content-services">
<h2 style="text-align: center;">RED FERRARI</h2>
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Sed haec quidem liberius ab eo dicuntur et saepius. Plane idem, inquit, et maxima quidem, qua fieri nulla maior potest.
</div>
</div>
<div class="col-right-services">
<div class="content-services">
<img src="http://buyersguide.caranddriver.com/media/assets/submodel/6873.jpg" />
</div>
</div>
</div>
</section-services>
<section-services>
<div class="row-services">
<div class="col-left-services">
<div class="content-services">
<img src="http://buyersguide.caranddriver.com/media/assets/submodel/6866.jpg" />
</div>
</div>
<div class="col-right-services col-floated">
<div class="content-services">
<h2 style="text-align: center;">YELLOW FERRARI</h2>
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Sed haec quidem liberius ab eo dicuntur et saepius. Plane idem, inquit, et maxima quidem, qua fieri nulla maior potest.
</div>
</div>
</div>
</section-services>

Order right column between two divs on left column in Foundation

With mobile-first in mind, I have an html structure that stacks 3 divs (when on mobile) vertically.
JSFiddle: https://jsfiddle.net/danbrellis/mozez66k/1/
<div class="row">
<div class="small-12 large-3 columns">
<div class="panel small-12 columns googleMapFormContainer">
<h3 class="googleMapFormContainer-title">Find a Group Near You</h3>
<form class="googleMapForm" id="near-group-search">
<div class="row">
<div class="small-6 large-6 columns">
<label>ZIP Code
<input id="zip" type="text" name="zip" placeholder="ZIP Code" />
</label>
</div>
<div class="small-6 large-6 columns">
<label>Radius (mi)
<select id="radius" name="radius">
<option value=10>10</option>
</select>
</label>
</div>
</div>
<div class="row">
<div class="small-12 columns googleMapForm-submitButtonContainer">
Search
</div>
</div>
</form>
</div>
</div>
<div class="small-12 large-9 columns">
<div style="margin-bottom: 20px;">
<img src="http://via.placeholder.com/1071x520" />
</div>
</div>
<div class="small-12 large-3 large-pull-9 columns ">
<div class="panel">
<p class="small-text">Lorem ipsum dolor sit amet, consectetur adipiscing elit. Phasellus sodales ex risus, ac lacinia tellus lobortis ut. Suspendisse quis tellus eget neque varius pretium. Praesent rutrum luctus volutpat</p>
<p class="small-text">Quisque sit amet pulvinar urna. Praesent at convallis libero. Ut egestas ac orci quis sollicitudin.</p>
</div>
</div>
</div>
Mobile display:
However, when on desktop, I need the middle div to be in a right column. Here's what I want:
I'm using foundation's pull-large-9 class on div 3 to get it to the left, but it clears div 2 so I end up with div 3 spaced too far below div 1.
What I'm getting:
Btw, I'm using Foundation 5 and compiling the scss. I appreciate any thoughts or input. Open to using JS but would prefer a css/html solution if possible.
When I had a similar issue (shown below),
This is what I did to fix it:
.wrapper {
display: flex;
flex-wrap: wrap;
justify-content: flex-start;
flex-direction: column;
height: 312px;
}
.box1 {
background-color: red;
width: 555px;
height: 312px;
}
.box2 {
background-color: blue;
width: calc(100% - 555px);
height: 200px;
}
.box3 {
background-color: green;
width: calc(100% - 555px);
height: 112px;
;
}
/* MOBILE RWD */
#media all and (max-width: 750px) {
.wrapper {
flex-direction: row;
}
.wrapper .box1 {
width: 100%;
order: 0;
}
.wrapper .box2 {
width: 100%;
order: -1;
}
.wrapper .box3 {
width: 100%;
}
}
<div class="wrapper">
<div class="box box1"></div>
<div class="box box2"></div>
<div class="box box3"></div>
</div>

Possible to force bootstrap columns to same height & vertically align divs + crossbrowser Support

So, I am trying to do the following:
Set columns in bootstrap to same height, regardless of content
Then, vertically align to center the content within those columns
And, make this all cross-browser compatible (min threshold for IE, 10+)
The first 2 steps are pretty easy with flexbox, but they leave out the ability for the content to look normal on IE 10+ in my browserstack tests.
Is anyone aware of how to do this? Here's a codepen of my current code that has issues on browserstack: http://codepen.io/myriad1729/pen/JRGVZO (HTML/CSS below)
You'll see it works on any modern browser, but on IE11, the 2nd column essentially appears to be pushed down a whole row, making everything look, well, not great, Bob.
I'd really appreciate if anyone has any insight here as to whether there's an easy one-stop-shop solution to this that I'm overlooking, if there's a problem in my CSS that's causing that issue on IE10/11, or if the solution is to selectively target IE10/11 and do...something.
Thanks!
CSS / HTML:
// And add in pertinent Bootstrap CSS
.row {
display: -webkit-box;
display: -webkit-flex;
display: -ms-flexbox;
display: flex;
flex-wrap: wrap;
align-items: center;
}
[class*="col-"] {
display: flex;
flex-direction: column;
}
.itemSource {
margin: 0;
}
h2 {
margin-top: 4rem;
font-size: 1.2em;
letter-spacing: 0;
margin-bottom: 2rem;
text-transform: uppercase;
color: #555;
font-weight: 300;
}
p {
font-size: 1em;
font-weight: 400;
}
<section class="listEntries">
<div class="row"> <!-- Caleb -->
<div class="col-xs-offset-3 col-xs-6 col-sm-offset-4 col-sm-4 col-md-offset-1 col-md-3 col-lg-offset-2 col-lg-2">
<img src="http://c51e0534b271998a1a94-58706dfbc342bfcb8f938b36c845fe8a.r14.cf1.rackcdn.com/uploads/first-person-sharing-our-story.jpg" class="img-circle img-responsive">
</div>
<div class="col-xs-12 col-sm-offset-1 col-sm-10 col-md-offset-0 col-md-8 col-lg-6">
<div class="itemSource">
<h2><strong>George Costanza</strong> Director</h2>
<p>
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nullam interdum bibendum justo, et gravida orci bibendum in. Nunc ornare nulla non eros ultrices vestibulum. Suspendisse vitae libero in ligula laoreet sodales. Vivamus in tortor et nulla euismod congue. Phasellus nec semper tellus. Sed sagittis magna id orci placerat, eget aliquet ante tincidunt. Suspendisse vitae mattis elit, in aliquam sem. Nunc efficitur finibus lorem, eu lobortis ante condimentum id. Aenean id augue ut turpis tincidunt viverra.
</p>
</div>
</div>
</div>
</section>
I use this solution for that problem
Without JavaScript.
I found it on this link.
<div class="row row-flex row-flex-wrap">
//Your well code
</div>
and add this css:
.row-flex, .row-flex > div[class*='col-'] {
display: -webkit-box;
display: -moz-box;
display: -ms-flexbox;
display: -webkit-flex;
display: flex;
flex:1 1 auto;
}
.row-flex-wrap {
-webkit-flex-flow: row wrap;
align-content: flex-start;
flex:0;
}
.row-flex > div[class*='col-'], .container-flex > div[class*='col-'] {
margin:-.2px; /* hack adjust for wrapping */
}
.container-flex > div[class*='col-'] div,.row-flex > div[class*='col-'] div {
width:100%;
}
.flex-col {
display: flex;
display: -webkit-flex;
flex: 1 100%;
flex-flow: column nowrap;
}
.flex-grow {
display: flex;
-webkit-flex: 2;
flex: 2;
}
Hope this will helpfull.

Having trouble vertically centering text next to image within Twitter Bootstrap [duplicate]

This question already has answers here:
vertical-align with Bootstrap 3
(26 answers)
Closed 7 years ago.
I'm using Twitter Bootstrap and am trying to vertically center text next to an image that is larger than the current text.
I can't use line-height because the text goes over more than one line and I also want to allow for possible additions to the text; so I went to the display: table; display: table-cell; method but it still refuses to work.
Here is my HTML for the respective section:
<div class="fs">
<div class="container">
<div class="wrapper row">
<div class="icon col-md-2">
<a href="" target="blank">
<img src="fs-icon.jpg" width="170" height="76" alt="Flying Solo Icon">
</a>
</div>
<div class="text col-md-10">
<span>
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Etiam tincidunt, lacus sed pharetra luctus, odio purus faucibus nunc, mattis molestie sapien libero sit amet leo.
</span>
</div>
</div>
</div>
<!-- Container Ends -->
</div>
<!-- FS Ends -->
CSS:
#about .fs {
padding: 30px 0;
}
#about .fs .wrapper {
display: table;
}
#about .fs .icon {
display: table-cell;
}
#about .fs .text {
display: table-cell;
min-height: 76px;
vertical-align: middle;
}
... and here it is on CodePen: http://codepen.io/anon/pen/XbdRXE
I think the CSS may be clashing with the behavior of the default Bootstrap CSS. However, you could bypass this method altogether and try using this as a custom class:
.vertical-center {
display: inline-block;
vertical-align: middle;
float: none;
}
Just apply it to your span element.

Resources