Looking to display book titles on a webpage with varying lengths. Some are short enough to fit in one line, while others are longer and wrap onto two lines.
Is it possible to apply different styles (such as color
or line-height
) for these two cases using only CSS?
For example, if the title fits on one line, make the color green. But if it extends to two lines due to length or window resizing, change the color to yellow?