Site logo

Archived topic

Price vertical alignment

7 replies · Started by David on February 28, 2020

Viewing posts 1–8 of 8

Hi,

I would like to align my products prices like in the pictures bellow:

Wrong:
wrong alignment

Correct:

correct

This is WC products shortcode displayed on homepage and I also need to achieve the same on shop page.

If possible, I prefer flex or "clean" way.

Thank you!

Hi there,

try this CSS:

.woocommerce ul.products li.product .woocommerce-LoopProduct-link {
    margin-bottom: unset !important;
    flex: 1;
    display: flex !important;
    flex-direction: column;
}

.woocommerce ul.products li.product .price {
    margin-top: auto !important;
}

It works. Thank you. :)

You're welcome

Hi there David!
Can you please add something to this CSS in order to align the star ratings too?
It works for me too, but the stars are misaligned.
https://www.offroadmax.ro

Thanks!

Hi there,

remove this CSS rule:

.woocommerce ul.products li.product .price {
    margin-top: auto !important;
}

And add this instead:

.woocommerce ul.products li.product .star-rating {
    margin-top: auto !important;
}

You continue to amaze me with your support. :)
I simply came to believe that I pay too little for so much attention and for such quick and HELPFUL answers!

Chapeau!

Awesome - glad to be of help

This archived topic is closed to new replies.