Beefy Boxes and Bandwidth Generously Provided by pair Networks
laziness, impatience, and hubris
 
PerlMonks  

Those 'wide load' posts

by talexb (Canon)
on Oct 15, 2007 at 17:51 UTC ( #644992=monkdiscuss: print w/replies, xml ) Need Help??

There have been a couple of posts in the last few weeks that have used the <pre> tag instead of the <code> tag, with the result that a really long line of code or output isn't wrapped, making the main page of the site really w-i-d-e.

These super wide posts do get considered, and after a while the problem is addressed, but in the mean time, it bugs me. I admit that this is a pet peeve -- blame that on my background in newspaper production. A solution that suggests itself is to get rid of the <pre> tags that allow this kind of thing to happen. Is this tag necessary?

I think I'd rather have a chunk of code that's unreadable because it's rendered in a proportional font, than having something that looks fine, except that it's 200 characters wide and ruins the rest of the page.

Alternatively, can I suggest or gently urge the Janitors to act a little more quickly on the posts that require <code> tags in place of <pre>?

Another alternative is to move the hint If you think you're going to use <pre> tags don't! .. so a spot above the list of approved tags -- although I don't know if that would work any better than the current solution.

    Welcome, newcomer!
    You're posting output or scripts?
    We prefer code tags.

Alex / talexb / Toronto

"Groklaw is the open-source mentality applied to legal research" ~ Linus Torvalds

Replies are listed 'Best First'.
Re: Those 'wide load' posts
by grinder (Bishop) on Oct 15, 2007 at 18:44 UTC

    It wouldn't matter if you put it in a 24 point red blinking typeface marquee and played a wave file. People would still ignore it.

    The problem is more with how your browser renders the results, rather than any sin on the part of a naive user. I believe the following CSS will fix the problem:

    .code { overflow: auto; } .pre { overflow: auto; }

    (update: not quite correct (IANACSSM), see the solution below) And then you'll never have a wide screen again.

    • another intruder with the mooring in the heart of the Perl

      .code { overflow: auto; }

      PerlMonks emits no <code> tags so I think that that bit of CSS does nothing here.

      I hope someone can do the footwork to validate the other half so we can just add it to the PerlMonks standard CSS, if it works well enough.

      - tye        

        "I hope someone can do the footwork to validate the other half.."
        hmm, unless I'm doing something wrong, I'd have to say that it doesn't seem to work. I've added .pre { overflow: auto; } to my Onsite CSS Markup under Display Settings, and then added some extra-wide text contained in <pre> tags to my pad - but it doesn't autowrap.
        That's working on blocks with a class of 'code', and it seems the code tags get output as pre blocks with that class.
Re: Those 'wide load' posts
by idsfa (Vicar) on Oct 16, 2007 at 14:04 UTC
    I use the following:
    /* code side-scroll */ .code { overflow: auto; font-family: monospace; display: block; background-color: #ddd; border: solid #888 1px; padding: 10px; width: 90%; margin-right: 0px; margin-left: auto; }
    Works great on Firefox. Changes to make this work for pre as well should be obvious. (Though I use a different background color)

    The intelligent reader will judge for himself. Without examining the facts fully and fairly, there is no way of knowing whether vox populi is really vox dei, or merely vox asinorum. — Cyrus H. Gordon
Re: Those 'wide load' posts
by Argel (Prior) on Oct 16, 2007 at 23:43 UTC
    My take on this problem was to move the nodelets to the left. I suggested this in Nodelets on the left? and thanks to the help of several Monks we have code you can add to your free nodelet to pull this off. Once that's done the "wide load" posts become more of an annoyance. The "final" solution is in Re^9: Free Nodelet Hack: Nodelets on the left.

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: monkdiscuss [id://644992]
Approved by Arunbear
Front-paged by Old_Gray_Bear
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others lurking in the Monastery: (3)
As of 2020-10-25 09:02 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    My favourite web site is:












    Results (249 votes). Check out past polls.

    Notices?