- This topic has 10 replies, 2 voices, and was last updated 4 years, 9 months ago by Andrew Misplon.
- AuthorPosts
- February 23, 2020 at 6:48 pm #14034
GeorgeParticipantHi team,
I’m trying to center align product title, price, variations and add to cart button on product page. I came up with this code:
body.single-product #main .post .entry-summary{ text-align:center; }
However product variations are still on the left side after applying the code. Please help!
February 24, 2020 at 10:55 am #14035
Andrew MisplonKeymasterHi George
Thanks for reaching out.
Please, send a link to an existing product and I’ll take a look at what you’ve done so far.
February 24, 2020 at 12:38 pm #14040
GeorgeParticipantThis reply has been marked as private.February 24, 2020 at 7:16 pm #14041
Andrew MisplonKeymasterThanks, variations are contained in an HTML table. I’m not sure that there is an easy way to achieve what you’re after here. If you right-click and inspect element and take a look at how the table is constructed, it’ll help to understand what’s going on there.
The following will center align the text within each table cell:
.single-product .variations tr { text-align: center; }
Alternatively, the following will center align the second table cell but right align the first table cell, probably better for what you’re trying to do:
.single-product .variations tr { text-align: center; } .single-product .variations tr .label { text-align: right; }
—
Polestar is loading both the min and non-min stylesheet which isn’t correct. I’m not quite sure that’s happening. Go to
Dashboard > Updates
, there should be a theme update pending. If so, try updating to see if that issue resolves. I can check once you’ve updated.February 24, 2020 at 8:12 pm #14042
GeorgeParticipantHey Andrew,
I’ve updated the theme and added the code you provided. The result can be seen on the link I sent. It is better than before but not best.
I basically need to apply this on the mobile version of my website. Is there a way to implement it only on mobile and leave it as it is for desktop?
February 25, 2020 at 8:55 am #14043
Andrew MisplonKeymasterSure, you could wrap the rule in a media query:
@media (max-width: 768px) { .single-product .variations tr { text-align: center; } .single-product .variations tr .label { text-align: right; } }
February 25, 2020 at 6:49 pm #14045
GeorgeParticipantHi Andrew,
Thank you, that’s what I was looking for 🙂
February 25, 2020 at 6:56 pm #14046
GeorgeParticipantThis reply has been marked as private.February 25, 2020 at 6:58 pm #14047
Andrew MisplonKeymasterGlad to hear you’re making progress 🙂
.bk-social-proof-embed .social-proof-widget.widget-balance { justify-content: center; }
February 26, 2020 at 4:34 am #14049
GeorgeParticipantWorked like a charm. You’re awesome ?
February 26, 2020 at 8:36 am #14050
Andrew MisplonKeymasterSuper 🙂 Glad that helped.
- AuthorPosts
You must be logged in to reply to this topic.