http://qs1969.pair.com?node_id=509881

Why is the PerlMonks page too wide?

That is, something is causing the page to be wider than my browser window, forcing me to scroll horizontally.

This node describes some of the most common causes of pages rendering too wide.

Sometimes, the problem is purely an issue of the content of the node. Because these affect everyone, regardless of settings, the solutions necessarily involve "fixing" the node. Examples:

  1. You're viewing a node that has a long line inside of a <pre> tag.

    Solution: /msg the author or solicit one of the janitors to fix the problem. (This usually means replacing the <pre> tags with <code> tags.)

  2. You're viewing a node that has a very long string containing no whitespace. (Note - This could affect different users differently, because line-wrapping behavior is browser dependent. Some browsers wrap on certain non-whitespace characters. And some browsers (notably IE) are crazy enough to not wrap on certain types of whitespace such as a space followed by a slash).

    Solution: /msg the author or solicit one of the janitors to fix the problem. (The usual fix is to put the very long string into <code> tags with a newline.)

In other cases, the problem is an issue of how the node content is interacting with your Display Settings. You should suspect one of these might be the cause if you see a particular node render very wide but no one else does.

  1. You're viewing a node with a long line of code, and you have "Code Wrapping Off" checked (in your Display Settings). This disables all code wrapping; it makes <code> blocks effectively like <pre> blocks.

    Solution: Un-check "Code Wrapping Off" in your Display Settings.

  2. You're viewing a node with a code block containing a long string with no whitespace, and you have "Auto Code Wrap" turned on (see New code wrap options), and you have your "Code Wrap Length" set quite high in your Display Settings.

    Solution: You should either set your "Code Wrap Length" to something low, like between 20 and 40; or turn off "Auto Code Wrap" entirely.

  3. You're viewing a node with a code block containing a long string with no whitespace, and you have "Auto Code Wrap" turned on (see New code wrap options), but you're using a browser that doesn't support soft hyphens.

    Solution: For quite a while, IE was the only browser that supported soft hyphens. But support for soft hyphens is now much more common. If your browser doesn't, it's time to think about upgrading. If that isn't an option, then you can simply turn off "Auto Code Wrap".

Other possible causes:

  1. You're viewing a public or private /msg containing a long line that trickily thwarts the Chatterbox Nodelet's efforts to ensure a sane wrap width. (It does this by inserting whitespace into long strings of non-spaces.) Or possibly the Chatterbox Nodelet is inserting those spaces as intended, but your browser isn't wrapping on them (as noted above).

    Solution: In either case, you basically have two options: switch browsers, or bear with it until the offending message goes away. (If it's in your message inbox, you can delete it.)

  2. You added CSS (in your Display Settings) that makes textareas wide (for example, textarea { width: 100%; }

    Solution: reduce that to a value that works for you, such as 75%. Or remove it altogether.

  3. You've added some text to your Personal Nodelet or Free Nodelet that's forcing your nodelet sidebar to be wider than normal.

    Solution: edit the contents of your Personal Nodelet or Free Nodelet. URLs, for example, should have relatively short link text. Also remember that browsers wrap (break) on whitespace rather liberally — a fact you can exploit to good effect.

Based on the threads Pages often too wide, Occasional PM's page width problem, Monastery Gates page is too wide, New code wrap options, Space or Soft Hyphens, and others.


Back to PerlMonks FAQ