Samir Ghobril
Samir Ghobril

Reputation: 5229

How to line break after long word

Hey guys, I have a comments section and if a user writes something like blablablablablabla or something really long, the word doesn't break, but goes on straight, making the page look weird. How could I fix it and make it break the word?

Upvotes: 2

Views: 972

Answers (3)

Abudayah
Abudayah

Reputation: 3875

Please Note:

word-wrap: break-word;

not valid in W3C

Upvotes: 0

amosrivera
amosrivera

Reputation: 26514

this can be fixed with css

comment{
    word-wrap:break-word;    
}

Check it out here:

http://www.webdesignerwall.com/tutorials/word-wrap-force-text-to-wrap/

Upvotes: 2

Felix Kling
Felix Kling

Reputation: 816334

This can be solved with CSS. Have a look at word-wrap:

.comment {
    word-wrap: break-word;
}

will break overflowing words.

Upvotes: 0

Related Questions