Hutchy68 / pivot

A MediaWiki mobile skin which "Pivots" seamlessly to any size display.
https://pivot.wikiproject.net
BSD 2-Clause "Simplified" License
37 stars 18 forks source link

Vertical align of grids content #108

Open LaurentNautilus opened 3 years ago

LaurentNautilus commented 3 years ago

Hello! Thanks a lot for the skin!

I am having problems with the grid when the cells are of different sizes. For example:

1

As you can see, the content in the first two cells is stuck to the top, and I would like to place it in the center, like this: 2

LaurentNautilus commented 3 years ago

I fixed this with apply the following code to the .row display: flex; align-items: center; But it breaks responsive design - column classes stop working. I fixed it again with
@media only screen and (max-width:640px) { .row {display: block;} } but it looks like kludge

Hutchy68 commented 3 years ago

You want to do something like this.

<div class="row valign-middle">
<div class="large-3 columns">
Content....
</div>
<div class="large-3 columns">
Content....
</div>
<div class="large-3 columns">
Content....
</div>
<div class="large-3 columns">
Content....
</div>
</div>

Then add this CSS

.valign-middle {
  display:-webkit-box;
  display:-ms-flexbox;
  display:flex;
  -webkit-box-align:center;
  -ms-flex-align:center;
  align-items:center;
}

A row row CSS chain tends to have a wider width issue. So you might want to wrap the whole thing in a

<div class="large-12 columns">
<div class="row valign-middle">
then all the columns
</div> /* end row */
</div> /* end large-12 columns */

Try them both and post back.

LaurentNautilus commented 3 years ago

Work fine, thanks.