Can't break a long string/text, it exceeds the width of html div
<div id="id_div_comments"><p>body4qqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqq开发者_Go百科qqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqq</p></div><br/><br/>
</div>
The css file:
div#id_div_comments {
width: 400px;
}
But the string/texts exceeds the division width. What can i do to break the texts when it reaches the width of the division ?
wirte this in your css word-wrap:break-word;
css:
#id_div_comments p{
word-wrap:break-word;
}
Try this code:
#id_div_comments p{
white-space:normal;
}
The accepted answer doesn't work for me
After seaching around, the following css actually works
#id_div_comments p{
overflow: hidden;
}
Just trust me
Old question but no correct answer, for long text this should work
#id_div_comments p{
word-break: break-all;
}
精彩评论