Skip to content
This repository has been archived by the owner on Jul 30, 2022. It is now read-only.

Vertical align of grids content #108

Open
LaurentNautilus opened this issue Apr 25, 2021 · 3 comments
Open

Vertical align of grids content #108

LaurentNautilus opened this issue Apr 25, 2021 · 3 comments

Comments

@LaurentNautilus
Copy link

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
Copy link
Author

LaurentNautilus commented Apr 25, 2021

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
Copy link
Owner

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
Copy link
Author

Work fine, thanks.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants