How to display the first line of a product name.
Some product names are long, so displaying only the first line and hiding the rest is a nice way to display them. The key point is to make sure the height of the product name is divisible by its line height. The default line-height is 1.5 rem, so set the height to 1.5 rem to get one line, set the height to 3rem to get two lines.Â