Discuss and resolve questions on Liquid, JavaScript, themes, sales channels, and site speed enhancements.
Hi here is the button I coded.
https://k41qdbx52ltq4oeh-57309069474.shopifypreview.com
When the mouse is hovered on the text, the underline animation shows, but not the button image.
How do you show the underline animation when the mouse is hovered on the image?
Thank you in adavance!
<div class="flex justify-center mt-10 md:mt-16">
<a class="read-more_btn text-lg md:text-xl hover:opacity-70" href="/blogs/news"><span class="underline">もっと読む</span></a>
</div>
<style>
.read-more_btn:after {
content: "";
display: inline-block;
width: 56px;
height: 56px;
background-image: url('{{ ' arrow-btn.svg' | file_url }}');
background-size: contain;
vertical-align: middle;
margin-left: 16px;
}
.underline {
padding-bottom: 5px;
position: relative;
}
.underline::before {
background: #333;
content: "";
width: 100%;
height: 1px;
position: absolute;
left: 0;
bottom: 0;
margin: auto;
transform-origin: right top;
transform: scale(0, 1);
transition: transform 0.3s;
}
.underline:hover::before {
transform-origin: left top;
transform: scale(1, 1);
}
.underline.active:hover {
border-bottom-color: transparent;
/* Activeなページに対してhover時に下線を無効にする */
}
</style>
Please try to change those code
.underline {
padding-bottom: 5px;
position: relative;
}
.underline::before {
background: #333;
content: "";
width: 100%;
height: 1px;
position: absolute;
left: 0;
bottom: 0;
margin: auto;
transform-origin: right top;
transform: scale(0, 1);
transition: transform 0.3s;
}
.underline:hover::before {
transform-origin: left top;
transform: scale(1, 1);
}
.underline.active:hover {
border-bottom-color: transparent;
/* Activeなページに対してhover時に下線を無効にする */
}
To this
.read-more_btn {
padding-bottom: 5px;
position: relative;
}
.read-more_btn::before {
background: #333;
content: "";
width: 100%;
height: 1px;
position: absolute;
left: 0;
bottom: 0;
margin: auto;
transform-origin: right top;
transform: scale(0, 1);
transition: transform 0.3s;
}
.read-more_btn:hover::before {
transform-origin: left top;
transform: scale(1, 1);
}
.underline.active:hover {
border-bottom-color: transparent;
/* Activeなページに対してhover時に下線を無効にする */
}
- Helpful? Like & Accept solution!
- Ryviu - Product Reviews & QA app: Import reviews from AliExpress, Amazon, Etsy, Walmart, Dhgate and CSV.
- Amazon Products Importer - Import Amazon Products to Dropship in Your Store!
- 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.
- En...Sign up now.
Thank you.
When I typed the code, the button looks like this.
I don't want the underline underneath the button image, only the text.
https://www.awesomescreenshot.com/video/21857173?key=d47726ff96b9d5793987ac75701103ba
Learn how to build powerful custom workflows in Shopify Flow with expert guidance from ...
By Jacqui May 7, 2025Did You Know? May is named after Maia, the Roman goddess of growth and flourishing! ...
By JasonH May 2, 2025Discover opportunities to improve SEO with new guidance available from Shopify’s growth...
By Jacqui May 1, 2025