how to limit the product title in one line on collection page? my theme is taste

Solved

how to limit the product title in one line on collection page? my theme is taste

momo110
Tourist
29 0 1

the product title on collection page is fully presented and I will want it to be display only one row without changing font size. it will end with "..." if the title exceeds one row. Here is my website: https://jonvidesign.com/ and attached photo is what I want.

未命名1721634918.png

Accepted Solutions (2)

oscprofessional
Shopify Partner
16343 2438 3179

This is an accepted solution.

Hello @momo110 

  1. From your Shopify admin, navigate to Online Store > Themes.
  2. Find the Testament theme and click Actions > Edit code.
  3. In the Assets folder, navigate to the base.css  file.
  4. Add the following css code at the end 





.card__heading a {
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
max-width: 350px;
width: 100%;
}

 

image_2024_07_22T08_06_57_459Z.png

 


I hope this helps!
Thanks

Hire us | Pass Core Web Vital | B2B Wholesale Experts | Claim Your Free Website Review |
Connect with Us: WhatsApp | Skype: oscprofessionals-87 | Email: pallavi@oscprofessionals.com |
Custom Shopify SolutionsPrivate Apps, Theme Customization & SEO | Digital Marketing |
OSCP Apps: Discount Suite | Wholesale App | Bundle & Upsell | Shipping Discount | and more...

View solution in original post

Raj-webdesigner
Shopify Partner
358 90 87

This is an accepted solution.

Add This css In you edit Code > base.css file

 

 

 

 

.card__heading a {
  display: -webkit-box;
  -webkit-line-clamp: 1;
    max-width: 350px;
  text-overflow: ellipsis " [..]";
  -webkit-box-orient: vertical;
  overflow: hidden;
}

 

 

 

Try This Code This Code Work On Mobile Also

Rajwebdesigner_0-1721636644614.png

 

Are you looking for Shopify Developer then your search is over I will help you


If you require further help to optimize your store, please don’t hesitate to reach out.


This contribution will always benefit you and you will get my full help easily and you can contact me easily.


Your Willpower Contribution Link

:-

❤️Tip❤️

Contect On My Mail :-Mail@gmail.com


View solution in original post

Replies 7 (7)

oscprofessional
Shopify Partner
16343 2438 3179

This is an accepted solution.

Hello @momo110 

  1. From your Shopify admin, navigate to Online Store > Themes.
  2. Find the Testament theme and click Actions > Edit code.
  3. In the Assets folder, navigate to the base.css  file.
  4. Add the following css code at the end 





.card__heading a {
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
max-width: 350px;
width: 100%;
}

 

image_2024_07_22T08_06_57_459Z.png

 


I hope this helps!
Thanks

Hire us | Pass Core Web Vital | B2B Wholesale Experts | Claim Your Free Website Review |
Connect with Us: WhatsApp | Skype: oscprofessionals-87 | Email: pallavi@oscprofessionals.com |
Custom Shopify SolutionsPrivate Apps, Theme Customization & SEO | Digital Marketing |
OSCP Apps: Discount Suite | Wholesale App | Bundle & Upsell | Shipping Discount | and more...
momo110
Tourist
29 0 1

Hello sir, it works on pc device but it seems that something is wrong on mobile. kindly check

momo110
Tourist
29 0 1

41037fa0242f14bf0df0c23808fabb0.jpg

niraj_patel
Shopify Partner
2391 516 515

You can add code by following these steps

1. Go to Online Store -> Theme -> Edit code.
2. Open your theme.liquid file

3. Paste the below code before </body> on theme.liquid
<style>
@media screen and (max-width: 767px) {
.card__heading a {
max-width: 26% !important;
}
}
</style>
Was my reply helpful? Click Like to let me know!
Was your question answered? Mark it as an Accepted Solution.

Shopify Partner || Helping eCommerce Stores
- Was my reply helpful? Click Like to let me know!
- Was your question answered? Mark it as an Accepted Solution.
- For further discussion contact: Email ID- info@techlyser.com
momo110
Tourist
29 0 1

901d3336533dccfcb6531c66294dc2f.jpg

it looks not long enough and also affects price position, pls have a look

Raj-webdesigner
Shopify Partner
358 90 87

This is an accepted solution.

Add This css In you edit Code > base.css file

 

 

 

 

.card__heading a {
  display: -webkit-box;
  -webkit-line-clamp: 1;
    max-width: 350px;
  text-overflow: ellipsis " [..]";
  -webkit-box-orient: vertical;
  overflow: hidden;
}

 

 

 

Try This Code This Code Work On Mobile Also

Rajwebdesigner_0-1721636644614.png

 

Are you looking for Shopify Developer then your search is over I will help you


If you require further help to optimize your store, please don’t hesitate to reach out.


This contribution will always benefit you and you will get my full help easily and you can contact me easily.


Your Willpower Contribution Link

:-

❤️Tip❤️

Contect On My Mail :-Mail@gmail.com


niraj_patel
Shopify Partner
2391 516 515

Hello @momo110 

You can add code by following these steps

1. Go to Online Store -> Theme -> Edit code.
2. Open your theme.liquid file

3. Paste the below code before </body> on theme.liquid
<style>
 .collection h3.card__heading.h5 a {
       width: 100%;
       max-width: 69%;
       white-space: nowrap;
       text-overflow: ellipsis;
       overflow: hidden;
  }
</style>

techlyser_web_0-1721593053772.png

Was my reply helpful? Click Like to let me know!
Was your question answered? Mark it as an Accepted Solution.

Shopify Partner || Helping eCommerce Stores
- Was my reply helpful? Click Like to let me know!
- Was your question answered? Mark it as an Accepted Solution.
- For further discussion contact: Email ID- info@techlyser.com