Shopify themes, liquid, logos, and UX
We're moving the community! Starting July 7, the current community will be read-only for approx. 2 weeks. You can browse content, but posting will be temporarily unavailable. Learn more
Hello
I am looking to change the position of the buy now button on my products. I already have a hover effect on it and wish for the button to be in the middle of the product image so when you hover over the product the buy button appears in the middle of the products image.
The code I used for the hover effect is:
.product-card-wrapper .quick-add {
display: none; /* Hide button initially */
}
.product-card-wrapper:hover .quick-add {
display: block; /* Show button on hover */
}
.product-card {
/* Other styles */
text-align: center; /* Centers the button */
}
Solved! Go to the solution
This is an accepted solution.
Please update this code from this
.product-card-wrapper:hover .quick-add {
display: block; /* Show button on hover */
To this
.product-card-wrapper:hover .quick-add {
display: block;
position: absolute;
top: 40%;
left: 50%;
transform: translate(-50%, -40%);
width: 100%;
}
- Helpful? Like & Accept solution!
- Ryviu - Product Reviews & QA app: Collect customer reviews, import reviews from AliExpress, Amazon, Etsy, Walmart, Dhgate and CSV.
- Lookfy Gallery: Lookbook Image - Gain customers with photo gallery, video & shoppable image.
- Reelfy‑Shoppable Videos+Reels: Create shoppable videos to engage customers and drive more sales.
- Enjoy 1 month of Shopify for $1. Sign up now.
Hi @CAVinhus
Could you share the link to your page?
- Helpful? Like & Accept solution!
- Ryviu - Product Reviews & QA app: Collect customer reviews, import reviews from AliExpress, Amazon, Etsy, Walmart, Dhgate and CSV.
- Lookfy Gallery: Lookbook Image - Gain customers with photo gallery, video & shoppable image.
- Reelfy‑Shoppable Videos+Reels: Create shoppable videos to engage customers and drive more sales.
- Enjoy 1 month of Shopify for $1. Sign up now.
This is an accepted solution.
Please update this code from this
.product-card-wrapper:hover .quick-add {
display: block; /* Show button on hover */
To this
.product-card-wrapper:hover .quick-add {
display: block;
position: absolute;
top: 40%;
left: 50%;
transform: translate(-50%, -40%);
width: 100%;
}
- Helpful? Like & Accept solution!
- Ryviu - Product Reviews & QA app: Collect customer reviews, import reviews from AliExpress, Amazon, Etsy, Walmart, Dhgate and CSV.
- Lookfy Gallery: Lookbook Image - Gain customers with photo gallery, video & shoppable image.
- Reelfy‑Shoppable Videos+Reels: Create shoppable videos to engage customers and drive more sales.
- Enjoy 1 month of Shopify for $1. Sign up now.
Thank you so much this worked! Do you also know how I changed the text on the button?
You can change text from your store admin > Sales channels > Online Store > Themes > click "..." in Current theme > Edit default theme content, search and change that text.
- Helpful? Like & Accept solution!
- Ryviu - Product Reviews & QA app: Collect customer reviews, import reviews from AliExpress, Amazon, Etsy, Walmart, Dhgate and CSV.
- Lookfy Gallery: Lookbook Image - Gain customers with photo gallery, video & shoppable image.
- Reelfy‑Shoppable Videos+Reels: Create shoppable videos to engage customers and drive more sales.
- Enjoy 1 month of Shopify for $1. Sign up now.