Card Element Size Issue

Hi there,

Using the card element (Not classic card) in PRO and I am having sizing issues. I need them to stay the same size no matter what size screen I am using. I currently can get one screen set, but then when changing to a smaller screen, the cards don’t line up as I need them to. I followed some other threads that had JS, but that did not change anything on my site.
Any advice?

https://rrthevillage.wpengine.com/ministries/#adults
Smaller screen: https://prnt.sc/xgv9gp
Larger screen: https://prnt.sc/xgvafp

Hello @tkcostello,

Thanks for writing in!

To get your issue resolved, click each of the card element and find the “Customize” tab:

In the “Element CSS” field, edit the CSS and insert this:

$el {
  min-height: 120px;
}

This code will set a minimum height for each card. Make sure that the minimum height for each card is the same so that they will be aligned and uniform in height upon loading your page.

Best Regards.

Thank you. That did help with the height, but the buttons are now stretched out and large…

I ended up removing that CSS and just making them all one line and changed the row layout, but in general is there not a way to force the same size for this element even is text on front or back is different per card?

Howdy, @tkcostello! Thanks for writing in and great question. You can absolutely get your cards to line up, but it requires a bit of setup throughout your Rows / Columns to get things functioning properly. Each individual Card itself will always ensure that its height will be set by the tallest face between the two sides of the Card, but that is the extent to which it can perform this action because it cannot know anything beyond itself in terms of a styling context. Therefore, to get multiple cards in the same Row all matching their heights to the height of the tallest card in the Row, you must perform something like the following. Go to your Row and ensure that the Align Vertical setting is set to Stretch, which will ensure that all of your Columns on the same line will match in height:

Next, go to each of your Cards and set their Width to 100% to ensure that they fill all horizontal space within a Column (this is needed because of our next step):

Finally, go to each Column in your Row and enable its internal Flexbox layout and set the controls like so:

What we’re doing here is layout out our content inside the Column (just a Card in this case) in a Row configuration, but when we do this, we can set the Column’s Align Vertical control to Stretch, which will ensure that the content inside fills out the full height of that particular Column. Again, this must be setup on every Column, and every Card must have its Width set to 100% to ensure it doesn’t collapse in horizontally. Once these proper settings are employed, you will have Cards that respond in height to each others changes because now the markup has been styled accordingly to allow it to do so. Now you should notice that even if another one of the Cards wraps to a new line or grows in size, the other Cards will grow / shrink with it:

Hopefully that helps to point you in the right direction, cheers!

Yes, this is perfect!!! THANK YOU!

You’re welcome!

This topic was automatically closed 10 days after the last reply. New replies are no longer allowed.