user5307298 user5307298 - 6 months ago 22
CSS Question

How to break text inside a parent div with white-space:nowrap in CSS?

I am struggling to break the text inside a parent div with

white-space:nowrap
. The property
word-wrap:break-word
for anchor is not working. I created a JSFiddle.

Answer

All you need to do is add a different white-space rule for your div a block.

Example:

#viewed_products div a {
    white-space: normal;
}