in reply to A meta Style question

the <style>...</style> tag is valid only in an html header. therefore, it appears per page, not per node/posting.

you can apply cascading style sheets through use of the style tag on your homenode, hsmyers. there are two methods of applying styles to your pages here: linking to an external stylesheet, or storing style info onsite. this is a new feature, introduced on Petrucio's We Stylin'! node.

there are a few examples there. enjoy!

Update: i just added PerlMonks CSS Examples. hopefully, others will add their stylesheets here. you can cut and paste any of these examples in the spot provided on your homenode.

~Particle

Replies are listed 'Best First'.
Re: Re: A meta Style question
by hsmyers (Canon) on Feb 16, 2002 at 21:27 UTC
    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."
      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")