Beefy Boxes and Bandwidth Generously Provided by pair Networks
The stupid question is the question not asked
 
PerlMonks  

Re^4: Those 'wide load' posts (selectors)

by tye (Sage)
on Oct 17, 2007 at 16:43 UTC ( [id://645498]=note: print w/replies, xml ) Need Help??


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

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        

Replies are listed 'Best First'.
Re^5: Those 'wide load' posts (selectors)
by mr_mischief (Monsignor) on Oct 17, 2007 at 20:14 UTC
    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        

        Thanks for the tip. I like the way code is displayed better with auto code wrap turned on in Firefox, Opera, and IE generally. It appears the soft hyphen handling does save some side-scrolling in IE, but for pathological cases it still happens there.

        I'm not sure which method I'm going to use in the long run, but it's nice to have options. I might just raise my break limit on the non-auto to about where all my browsers on my main system will handle it maximized. It seems at the font size I use most of the time on the monitor and resolution I use most, I can easily get the browser into the 130-character range across all three of the most itneresting (to me) browsers. I've not run across many code sections with lines above that.

        Thanks again for the tip.

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://645498]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others pondering the Monastery: (4)
As of 2024-04-25 09:55 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found