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        


In reply to Re^4: Those 'wide load' posts (selectors) by tye
in thread Those 'wide load' posts by talexb

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.