in reply to Re^2: Those 'wide load' posts (code)
in thread Those 'wide load' posts

That's working on blocks with a class of 'code', and it seems the code tags get output as pre blocks with that class.

Replies are listed 'Best First'.
Re^4: Those 'wide load' posts (selectors)
by tye (Sage) on Oct 17, 2007 at 16:43 UTC

    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.

        Browsers have no control over what HTML PerlMonks chooses to emit. And, no, PerlMonks does not sniff user-agent strings in order to customize the HTML that it emits. Turn on "auto code wrap" (but don't forget to turn it back off; it is in one of the PerlMonks 'settings' pages) if you want to see different HTML emitted for <code> blocks.

        - tye