0

Don't know how to explain this. Let's see the picture enter image description here

enter image description here

See! Some text is showing divided. I used overflow hidden property. I've cut off the whole string into 200 letters. And then positioned it inside a div. This is dynamic. Problem occurs when someone put extra
or newlines in the paragraph. Then this happens. Can anyone please tell me how to stop this? These half sentences should not occur in that div as visible. Is there any system or property to stop this?

4

3 回答 3

0

First of all you need to remove any fixed height for the divs, probably replacing it for a min-height.

Second, you should set the property overflow:none, to avoid rendering to cut the contents of the div, and instead of that expand it to the required size.

于 2013-11-15T07:24:19.573 回答
0

use white-space: nowrap; for your div to show the text in one line.this way, it'll hide the extra text that comes in your div of fixed width as you have hidden the overflow

check this for ref :
http://css-tricks.com/almanac/properties/w/whitespace/
https://developer.mozilla.org/en-US/docs/Web/CSS/white-space
http://www.w3schools.com/cssref/pr_text_white-space.asp

于 2013-11-15T07:50:29.160 回答
0

you can even try overflow: scroll. By this no matter how much content you have, u can always scroll.

于 2013-11-15T10:40:28.680 回答