Submit Hint Search The Forums LinksStatsPollsHeadlinesRSS
14,000 hints and counting!

Mimic Opera's Fit to Width feature Web Browsers
The Opera web browser's Fit to Width feature eliminates horizontal scrolling on pages like this. However, if you don't or rarely use Opera, then here are some partial solutions. Mozilla browsers have a userContent.css option:
pre { white-space: -moz-pre-wrap !important; }
That will auto-format the aforementioned page, but it won't work on pages like this. The following bookmarklets, based on Ruderman's original and some variants attempt to fix this:

word-wrap for gecko browsers

WebKit browsers have a word-wrap:break-word built in, but not inside certain tags, and no -moz-pre-wrap equivalent:

word-wrap++ for webkit browsers

Change the width and/or prewidth variables to suit your screen size/resolution and possibly to get it to work with other sites. If the bookmarklets are mangled, you can copy the code/links directly from the source.

[robg adds: Keep in mind that the reason the pages get wide is that users have submitted code snippets without line breaks. Based on my testing (in Camino at least), the way these reformatters work is by inserting actual line breaks. If you then copy and paste the code as-is, it may or may not work. Remove the added line breaks if you have issues. I try to always format stories such that they don't require horizontal scrolling, but I have no control over comments.]

    •    
  • Currently 2.00 / 5
  You rated: 4 / 5 (4 votes cast)
 
[8,742 views]  

Mimic Opera's Fit to Width feature | 2 comments | Create New Account
Click here to return to the 'Mimic Opera's Fit to Width feature' hint
The following comments are owned by whoever posted them. This site is not responsible for what they say.
Mimic Opera's Fit to Width feature
Authored by: boxcarl on Jun 18, '07 02:36:49PM
Rob, you can set the CSS for comments to "overflow: scroll" to keep the overly wide comments from ruining the rest of the page.

[ Reply to This | # ]
Mimic Opera's Fit to Width feature
Authored by: ktopera on May 03, '08 09:08:17PM

Or you can just use Opera v9.5 beta2 and get fit-to-width baked in...it works great with one click or a site-dependant setting. ;)



[ Reply to This | # ]