How can I limit product titles to one line on my collection page?

How can I limit product titles to one line on my collection page?

Kogun1
Excursionist
29 0 5

Hello,
Is there any way to limit the product titles in my collection page to just one line and have a "..." at the end if there is more?

https://stronos.shop/
Pass: GWR

Replies 5 (5)

Made4uo-Ribe
Shopify Partner
9857 2345 2942

Hi @Kogun1 

Do you mean like this? 

Made4uoRibe_0-1705187028147.png

If it is, check this one. 

From your Shopify admin dashboard, click on "Online Store" and then "Themes".

Find the theme that you want to edit and click on "Actions" and then "Edit code".

In the "Assets" folder, click on "base.css, style.css or theme.css" file, depending on which file your theme uses to store its CSS styles. At the bottom of the file, add the following CSS code:

 

div#shopify-section-collection_page h3.product-title.pr.fs__14.mg__0.fwm {
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
}

 

And Save. 

 

 

Please don't forget to Like and Mark Solution to the post that helped you. Thanks!

If this fixed your issue, Likes and Accept as Solution are highly appreciated. Coffee tips fuel my dedication.
Get experienced Shopify developers at affordable rates—visit Made4Uo.com for a quick quote!
Need THEME UPDATES but have custom codes? No worries, for an affordable price.
Kogun1
Excursionist
29 0 5

Hello, I added this code at the bottom of my style.css file. However, it still does not limit the title. 

Made4uo-Ribe
Shopify Partner
9857 2345 2942

Check this one again. Thanks!

.nt_pr h3.product-title {
    overflow: hidden;
    white-space: nowrap !important;
    text-overflow: ellipsis !important;
}

And save. 

If this fixed your issue, Likes and Accept as Solution are highly appreciated. Coffee tips fuel my dedication.
Get experienced Shopify developers at affordable rates—visit Made4Uo.com for a quick quote!
Need THEME UPDATES but have custom codes? No worries, for an affordable price.
Kogun1
Excursionist
29 0 5

Hey, thanks for the follow-up. However, this code is still not fixing the issue. Would you possibly want collaborator access? Thanks!

PageFly-Richard
Shopify Partner
4902 1102 1776

 

Hi @Kogun1 

 

This is Richard from PageFly - Shopify Page Builder App

 

Please add this code to your theme.liquid above the </head> to get this solved

Step 1: Online Stores > Themes > More Actions > Edit code

Step 2: click on theme.liquid and paste the code above the </head>

<style>
.product-info__inner h3.product-title {
display: -webkit-box;
line-height: 1.3;
-webkit-line-clamp: 1;
-webkit-box-orient: vertical;
overflow: hidden;
text-overflow: ellipsis;
margin-top:10px;
}
</style>

 

Hope this can help you solve the issue 

 

Best regards,

Richard | PageFly

Please let me know if it works by giving it a Like or marking it as a solution!


➜ Optimize your Shopify store with PageFly Page Builder (Free plan available) 


All features are available from Free plan. Live Chat Support is available 24/7.