Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to wrap a very long word

Tags:

c#

css

I'm working on a c# web application and in one sections we show user comments on little boxes. It seems that one person wrote a long string causing the box become bigger.

How can I avoid long words to fit its container size?

For example, if the user writes the following

aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa

and my box has a shorter width

I should make it fit.

like image 875
Brian Roisentul Avatar asked Feb 12 '10 17:02

Brian Roisentul


1 Answers

Use the css property word-wrap: break-word. That will force long lines to wrap onto the next one.

like image 92
wsanville Avatar answered Sep 28 '22 11:09

wsanville