views:

372

answers:

1

You can see how the filename field should look at http://www.plifk.com/henvic/114 and how it breaks the layout at http://www.plifk.com/henvic/159

If I used 108574main-neutron-star-and-a-very-bad-overfow-will-happen-here-so-sad.mpg I would not get an overflow, but in the first line "108574main-neutron-star-and-a-very-" and in the second line a "bad-overfow-happens.mpg". What can I do to avoid getting an overflow?

Please know that I don't want to use quirks (like PHP's wordwrap, neither JavaScript if possible) and I've tried some ways in CSS with word-wrap, etc, but nothing worked out.

I've also tried word-break: break-all (tested on Firefox only) but it didn't work also.

Even the overflow: hidden; is not working... I'm not very familiar with web designing (indeed I try to do everything by the standards, etc) and I'm completely lost right now.

The uncompressed CSS file can be seen at http://pastebin.ca/1802451

Now... I really understand that this is expected once the word-wrap is supposed for text, not characters. But hey, even with break-all it doesn't do anything. How can?

Thank you very much in advance.

A: 

You can set #metasidebar {overflow: hidden;}. That'll work. Not sure you like how it cuts the text, but at least it doesn't overflow.

You could also try to cut the filename or insert breakpoints in php. Something like:

if(strlen($filename) > self::MAX_FILENAME_LENGTH) {
   // Make some smart splitting, or just insert a dash at a given length,
   // since rendering engines can line-break on dash
}
PatrikAkerstrand
Just saw that break-all is not supported by Firefox up to the version I'm using right now...And know I remember I had problems with this before.https://developer.mozilla.org/web-tech/2008/08/20/word-wrap-break-word/I think the problem lies in it not being supported by the browsers in the market.Whatever, I'm just going to use the overflow: hidden; even thought I don't like the idea. Also considered overflow-x: auto; overflow-y: none; but decide to use hidden instead with overflow-x: auto; overflow-y: none; so maybe someday it's just going to work... Hope there's nothing wrong.
Henrique Vicente