How to make the text the maximum width and go to the next line

I ran into a tiny problem. I canโ€™t solve it. I use awesome Ionic framework to create a nice application. trying to work with lists. I set the maximum width for the text, and I want the test to go to the next line, this does not work, I use word-wrap: break-word;

my text is as follows:

enter image description here

I want the text to move to the next line.

Here: CODEPEN CODE + DEMO

+5
source share
2 answers

You need to overwrite default ionic CSS from white space: no-wrap

 .item h3 { white-space: normal !important; } 

Codepen

Output

Normal wrap

But I would try to use a custom CSS file and load it after ionic CSS to avoid using it! important

+6
source

Overwrite the space property to break the line, and to center the text, add margin-left and margin-right auto;

 a.item h3 { margin-left: auto; margin-right: auto; white-space: normal; } 

Codepen

+1
source

All Articles