开发者

CSS Overflow auto

开发者 https://www.devze.com 2023-02-25 18:28 出处:网络
Hi i doing comment box in my webpage so that i am doing a validation of that comment box by not allowing the user to enter the empty comment, and a comment sholud not be greater than 255 characters it

Hi i doing comment box in my webpage so that i am doing a validation of that comment box by not allowing the user to enter the empty comment, and a comment sholud not be greater than 255 characters it all working fine but when i enter the comment like this means

aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaakjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjj

this string is overflowing out of the comment box div i.e it is going like a straight line I had used css property overflow: auto; but wat i need is it should be shown like this. it should split the string

aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaakjjjjjjjjj
jjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjj
jjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjj

for ex: when i comment like this The p element has both line boxes and a child box for the q element, which is a block-level element. The line boxes before the q are wrapped in an anonymous block-level box and so are the line boxes after the q. The resulting tree of boxes might be as fol

it coming up proper ... it sh开发者_运维技巧ould like this


What you need is CSS word-wrap: break-word;. It is widely supported among browsers.

word-wrap on CSS3.info

word-wrap: break-word


You can use CSS3 property to solve your question:

.text_wrap {
  word-wrap: break-word;
}
0

精彩评论

暂无评论...
验证码 换一张
取 消