This topic has 10 replies, 2 voices, and was last updated 9 years, 2 months ago ago by Eva Kemp
Hi there.
1. Is it possible to make a default space of 2 lines, in order for the products to be beautifully aligned?
2. Is it possible to end the title by three dots (…) if exceed the lenght of 2 lines?
Thanks
Peter
Hello,
You can refer to this article:
http://businessbloomer.com/woocommerce-shorten-product-titles/
Regards,
Eva Kemp.
Hi Eva.
I used this code to achieve what I wanted (thought).
I found out to set the minimum height so that there would be no alignment issues. However, on hover the last line now displays instead of just being cut off. And same is the case for those lines that are not filled with text. Can you help?
https://gofile.me/6lYKv/CfXOjfn3
.content-product .product-title a {
color: #0063be;
text-overflow: ellipsis;
word-wrap: break-word;
overflow: hidden;
max-height: 3.2em;
min-height: 3.2em;
line-height: 1.1em;
position: relative;
text-decoration: none;
padding-top: 20px;
}
Hello,
Try to remove padding-top: 20px;
from your code and check products after that.
Regards,
Eva Kemp.
True, that worked but now all 3 lines are displayed AND the text has no padding to product image. How do I increase that space to the product? And now I have 3 lines instead of 2…
Hello,
I’ve commented lines “min-height: 3.2em;” and “line-height: 1.1em;” in the code:
.content-product .product-title a {
color: #0063be;
text-overflow: ellipsis;
word-wrap: break-word;
overflow: hidden;
max-height: 3.2em;
/*min-height: 3.2em;
line-height: 1.1em; */
position: relative;
text-decoration: none;
}
Please check product pages now.
Regards,
Eva Kemp.
Thank you very much for your intentional help. Unfortuneately it now looks like this 🙂
Hello,
If you want to show only 2 lines in the title try to change max-height value in the code:
.content-product .product-title a {
color: #0063BE;
text-overflow: ellipsis;
word-wrap: break-word;
overflow: hidden;
max-height: 3.2em;
}
Set max-height to 2.4em.
Regards,
Eva Kemp.
Hi again
I think I have tried everything 🙁 But its still jumpin’ on hover. When I hover title-text, the whole textfield and add to basket-button the whole thing is jumping.
Hello,
I’ve added this code in child style.css:
.products-grid .product-title {
height: 3.2em;
}
Please check products now.
Regards,
Eva Kemp.
You must be logged in to reply to this topic.Log in/Sign up