in reply to Re: Those 'wide load' posts
in thread Those 'wide load' posts

.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        

Replies are listed 'Best First'.
Re^3: Those 'wide load' posts (code)
by McDarren (Abbot) on Oct 15, 2007 at 22:43 UTC
    "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.

      .pre { overflow: auto; }

      Note that this sets style for the class "pre", not the element.

      You probably want pre { overflow: auto; }. Dunno what browsers support it though.

      print "Just another Perl ${\(trickster and hacker)},"
      The Sidhekin proves Sidhe did it!

        Oh, duh.
        Well it's obvious how much I know about CSS, eh? ;)
        Yes, removing the leading period does the trick.
        In my current browser (Firefox 2.0.0.7), I now get a neat horizontal scrollbar (contained within the page) when viewing my pad.
Re^3: Those 'wide load' posts (code)
by mr_mischief (Monsignor) on Oct 17, 2007 at 16:29 UTC
    That's working on blocks with a class of 'code', and it seems the code tags get output as pre blocks with that class.

      Yes, there were either two errors in the original (thinking that <code> tags get output and that ".X" selects <X> tags) or just one typo (writing ".pre" instead of "pre"). Since the node was about <pre> tags, I just assumed the former and didn't go look up CSS selector syntax.

      To collapse the overlapping corrections from multiple replies, you'd want selectors of ".code" (class="code") and "pre" (<pre>) to get both types of blocks.

      and it seems the code tags get output as pre blocks with that class

      Sure, it seems that way to you. :) But PerlMonks <code> blocks are not output as <pre> blocks for me (because I mostly browse PerlMonks with a browser that has supported the standard soft hyphen (&shy;) for years, unlike FireFox, and so I can use "auto code wrap"). So it is better to use ".code" for selecting code blocks than "pre" (especially since the next major release of FireFox will finally support &shy; properly and "auto code wrap" rocks compared to fixed-width code wrapping so many will likely enable it.

      - tye        

        Which browser are you using that doesn't get:
        <pre class="code">
        in the page source? I'm seeing the same in Firefox 2, IE 7, Opera 9, Konqueror, and links.