Beefy Boxes and Bandwidth Generously Provided by pair Networks
Keep It Simple, Stupid
 
PerlMonks  

Perlmonks CSS font size hack

by xdg (Monsignor)
on Jul 30, 2004 at 18:40 UTC ( [id://378774]=monkdiscuss: print w/replies, xml ) Need Help??

I got tired of squinting at the tiny fonts that were rendering in my browser on Perlmonks and decided to try to fix it with some on-site CSS markup on my User Settings page. This turned out to be harder than I expected, but along the way I discovered an interesting hack that some people might find useful.

Much of the problem with setting font sizes on Perlmonks seems due to the fact that there are FONT elements sprinkled throughout the HTML source that override CSS styles put on elements like <p> and <td>. It's further compounded by the fact that individual posters may or may not post properly formatted HTML.

An interesting hack I found (at least on Firefox and IE6) is that you can apply a CSS style to a FONT element! This allows code like the following

tt font { font-size: 10pt; } ul font { font-size: 10pt; }

to override the font size settings on markup in the HTML like <tt><font size="-1"> (used for code) and <ul><font size="2"> (used for replies).

Separately (and perhaps this should be a separate PM Discussion post), in searching archives for CSS related nodes, it looks like there hasn't been any discussion since about 2003 on bringing PM up to date with (X)HTML/CSS standards (and eliminating non-CSS styling in the HTML). Currently, PM fails to even validate as proper HTML 4.0 Transitional as given in the DTD. (c.f. Perlmonks W3C Validation.) Maybe it's time to refresh that conversation since presumably, the old Netscape 4 holdouts have moved on to more modern browsers.

-xdg

Code posted by xdg on PerlMonks is public domain. It has no warranties, express or implied. Posted code may not have been tested. Use at your own risk.

Replies are listed 'Best First'.
Re: Perlmonks CSS font size hack
by chromatic (Archbishop) on Jul 30, 2004 at 19:00 UTC
    Maybe it's time to refresh that conversation since presumably, the old Netscape 4 holdouts have moved on to more modern browsers.

    I'd rather not revisit any conversations about this, unless the conversation starts with someone saying "Here's a patch." It's a good idea, so one or two people need to do it instead of multiple people talking about it and not doing anything.

      I'd love to donate time to it, if it comes together under the direction of a god/pmdev (I'm pretty solid with CSS neuter XHTML).

Re: Perlmonks CSS font size hack
by demerphq (Chancellor) on Aug 01, 2004 at 10:27 UTC

    Its an interesting project to clean the PM output. Code is scattered in a lot of places and without a rigorous project to eliminate it you'll have to put up with the current approach: As and when pmdev touches a node for some reason we usually do an HTML cleanup at the same time.

    As for converting everything over to use CSS, I think thats a policy change that hasn't occured yet. OTOH, im sure there are ways to make the page much easier to manage via CSS without compromising the "old look". pmdev lacks a guidline document on that, and as such we just do what seems most sensible. We also dont have a list of used class names, or the like. Theres a couple of projects that could be interesting for someone. Anyone interested in the CSS guidelines should speak with petruchio though.


    ---
    demerphq

      First they ignore you, then they laugh at you, then they fight you, then you win.
      -- Gandhi


Re: Perlmonks CSS font size hack
by CloneArmyCommander (Friar) on Jul 30, 2004 at 20:41 UTC
    Isn't there a Perl Module built to reformat code to XHTML standards. I think I have a copy somewhere I would be willing to dig up. I personally think that it would be too much of a hassle for somebody to be stuck with rewriting everything to comply with XHTML standards, especially since everything seems to be working fine.
Re: Perlmonks CSS font size hack
by ggg (Scribe) on Aug 02, 2004 at 00:23 UTC
    Here is another thread on that topic.
    ggg
A reply falls below the community's threshold of quality. You may see it by logging in.

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others wandering the Monastery: (4)
As of 2024-03-19 10:57 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found