Overflow Problem!

liunx

Guest
Ok my problem is that I have a div that displays text that it gets from a text file using a php script. I have the div set to a certain width and I have overflow: auto set. There are some lines in the text that have no spaces and they exceed the width of the div. It is making the div wider instead of cutting it to the size of the div. What I want to know is how can I set it up so even if the text contains no spaces it will still enforce the overflow function. I'm pretty sure I have seen this before but after doing many hours of searching I can find nothing. I would appreciate any help you guys can provide. :Doverflow:hidden ?Nope! I tried that already...
I have been doing a little more searching and I think my problem might have something to do with the text-overflow function or something close to that but I'm not sure. :(Overflow:hidden worked exactly as expected for me.

#foo {
width:200px;
border: 1px solid;
overflow: hidden;
}Well moreover, I don't wanna hide the text if it's too long. I want to force it into a carage-return if it's just one big block without spaces. Your right. It works just fine if it's a block of text with spaces but if there are no spaces, that is when the problem comes in! :(Ok, I found something that works and works good! However when trying to validate it through W3 it says it is not valid. I'm wundering if there is a valid equivalent to this? Here is what my div that is displaying it currently looks like:
<div style="overflow: auto; word-wrap: break-word; width: 400px; height: 150px;"><?php include("shout.txt"); ?></div>The text in bold is what is not validating. I will appreciate any help you guys can provide. :DThat's not CSS, that's IE CSS. Someone else may be able to comment on whether it's planned for CSS3 or beyond.

Well moreover, I don't wanna hide the text if it's too long. I want to force it into a carage-return if it's just one big block without spaces. Your right. It works just fine if it's a block of text with spaces but if there are no spaces, that is when the problem comes in!

Kinda hard to meet requirements that are mis-stated.:rolleyes:
 
Back
Top