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

remove underline links

remove underline links

FrisoPi
New Member
5 0 0

Hi, I want to remove underline's when linking a word to another page. I've tried different codes already on this forum, but none of them seems to work for me. 

Replies 6 (6)

rajweb
Shopify Partner
845 71 161

Hey @FrisoPi ,

To remove the underline from links, try adding this CSS rule:

a {
  text-decoration: none;
}

This will apply to all <a>  tags on your page. If you want it to apply only to certain links, you could use a class:

<a href="your-link" class="no-underline">Your Text</a>

Then add the CSS:

.no-underline {
  text-decoration: none;
}

Let me know if this works for you!

 

If I was able to help you, please don't forget to Like and mark it as the Solution!

Best Regard,

Rajat Sharma

Rajat | Shopify Expert Developer
Need a reliable developer for your next Shopify project? Let's connect!
Email: rajat.shopify@gmail.com
Portfolio: rajatweb.dev
Your one-stop partner for Shopify development, SEO, and performance. Let’s grow your store together!
FrisoPi
New Member
5 0 0

Doesn't work..

rajweb
Shopify Partner
845 71 161

@FrisoPi 

Could you share your store URL so I can check?

thanks

Rajat | Shopify Expert Developer
Need a reliable developer for your next Shopify project? Let's connect!
Email: rajat.shopify@gmail.com
Portfolio: rajatweb.dev
Your one-stop partner for Shopify development, SEO, and performance. Let’s grow your store together!
FrisoPi
New Member
5 0 0
FrisoPi
New Member
5 0 0

Just found the solution: 

 

<style>
.link, .prose a:not(.button) {
background-size: 0 1px;
}
.link:hover, .prose a:not(.button):hover {
background: linear-gradient(to right, currentColor, currentColor) 0 min(100%, 1.35em) / 100% 1px no-repeat;
}
</style>

 

This worked for me. 

rajweb
Shopify Partner
845 71 161

Great find! That CSS approach is a nice way to keep links styled subtly without the underline, while adding a hover effect. Let me know if you need any further adjustments!

Rajat | Shopify Expert Developer
Need a reliable developer for your next Shopify project? Let's connect!
Email: rajat.shopify@gmail.com
Portfolio: rajatweb.dev
Your one-stop partner for Shopify development, SEO, and performance. Let’s grow your store together!