in reply to Re: A meta Style question
in thread A meta Style question

A cool thing certainly, but unless I'm wrong (always possible), that allows me to change how a page looks to me, while what I'm looking for would allow a change to how the page looks for everyone. I will also admit, up front, that I've no earthly clue as to how you get around the only valid in the header problem, that's why I was hoping someone else had figured it out...

–hsm

"Never try to teach a pig to sing…it wastes your time and it annoys the pig."

Replies are listed 'Best First'.
Re: Re: Re: A meta Style question
by particle (Vicar) on Feb 16, 2002 at 22:06 UTC
    it is possible to use styles inline, that is, in the body of your html doc. you'd have to specify something like:

    <div style="color:red;">i see some red text <span style="color:red;background:black">and i want to paint it black< +/span> </div>
    which should show up as red text on your default background, followed by red text on a black background. here it is:

    i see some red text and i want to paint it black

    as you can see, it didn't work.

    in fact, if you view the page source, you should see something like:

    here it is:<P> i see some red text and i want to paint it black <P>
    perlmonks has a scrubber that removes illegal (as deemed by those most holy) attributes from html tags in the nodes you post.

    currently, the style attribute is not allowed. nor are div or span tags. so you can't use CSS inline at perlmonks. but all is not lost. you can use html attributes, like <font>, etc. here's an example, one of saint grinder's sigs...

    <SMALL>--</SMALL><H5><TT><FONT color="#cf1178">g</FONT> <FONT color="# +bd2188">r</FONT> <FONT color="#a73598">i</FONT> <FONT color="#904da7" +>n</FONT> <FONT color="#7866b5">d</FONT> <FONT color="#6080c2">e</FON +T> <FONT color="#4999ce">r</FONT></TT></H5>
    produces: --
    g r i n d e r

    this might be a solution for you. but you can't guarantee users will see what you want them to. CSS can override any tag, including <font>. my stylesheet overrides the font tag, so i see dark blue text on a light blue background.

    there are a few things, like font tags, that you can modify. feel free to experiment. if you see something you like, view the page source, and practice code reuse.

    Update: i *totally* forgot to link to the approved html tags! thanks for the catch, tye!

    ~Particle

      See perl monks approved html tags. But this filter is not applied to home nodes. Note that fixing some bugs will probably mean that a similar filter will eventually be applied to home nodes but with a larger list of allowed tags (or perhaps just a small list of disallowed tags).

      And no, I seriously doubt <div> (or at least <div style="...">) will be added to the list of approved tags. Changing fonts and/or colors is already heavily frowned upon by many visitors here, so I don't see us offering new ways of doing that.

              - tye (but my friends call me "Tye")
        I agree on tye's last comment; font & color changes specified by the poster are rather unwanted by most users. In talking with those that are prepping for the massive improvements to CSS usage on the site, however, I would suggest that it's rather trivial to add new html-like tags that can be used by someone with their own CSS to markup pages in their own way.

        For example, <spoiler>...</spoiler> would be translated to <div class="spoiler">...</div> (or span, depending on body or character context), and the default style sheet could be set to make these black text on black bg, but still allow a user to change that with their own specified stylesheet.

        -----------------------------------------------------
        Dr. Michael K. Neylon - mneylon-pm@masemware.com || "You've left the lens cap of your mind on again, Pinky" - The Brain
        "I can see my house from here!"
        It's not what you know, but knowing how to find it if you don't know that's important