Page margin

What do you want to see here? Some more categories, forums, and mods? Hmm...
User avatar
Tank Program
Forum & Project Admin, PhD
Posts: 6711
Joined: Thu Dec 18, 2003 7:03 pm

Re: Page margin

Post by Tank Program »

I believe Jonathan was being a bit facetious.

I'd forgotten about the overflow effects with div vs table. My initial thoughts are that I'd rather have things stretched to fit with enforced scrolling than to loose text off the edge of the screen. Of course, having the post body have its own scrollbars could be possible.

The ideal solution would probably be some JavaScript that rewrites the innerHTML to add hyphenation.
Image
Durf
Match Winner
Posts: 426
Joined: Mon Jul 30, 2012 10:35 pm

Re: Page margin

Post by Durf »

Here's a CSS solution:

First fiddle updated

Second fiddle updated

Same deal, adjust the width to mimic various resolutions to see the effect.
As you can see, the added css prevents horizontal scrolling entirely.

Note:
- this stuff isn't fully supported by all browsers (but at least the major ones are slowly being covered)
- there are differences in behavior (firefox will break up any word, even words like "at" "in" "of" making it ridiculous - chrome only breaks up the large word)
- there isn't any hyphen added at the line break (not like a javascript solution might have - as you suggested)

There is yet another alternative:
Using ­ to suggest where to hyphenate words (perhaps a phpBB mod to automatically add that entity to major words - and anything else longer than an expected word - not too hard to do)


Keep in mind that the problem is consecutive characters that aren't a hyphen.
So the problem itself isn't any real words; we could all just stop posting those problematic lines (or yet another phpBB mod could filter them out).
The effect in chrome is ideal, but unfortunately this CSS just isn't fully supported yet.

If you'd like, I can look into that javascript solution for you (would require modifications to the style though).
Post Reply