in reply to Style Sheet Doesn't Display Styles

It's all about visibility, or in Perl terms - scope. The page as you generate it expects to see the stylesheet in the same directory as the script, I think if you put a / in front you will force it to look at the root of the webserver ( ie domain.com/stylesheet.css ).

Your not the first person to get tripped up by this, it happened to me some years ago now when we first started using CSS.

jdtoronto

Replies are listed 'Best First'.
Re^2: Style Sheet Doesn't Display Styles
by CountZero (Bishop) on Jul 19, 2006 at 20:25 UTC
    Likely as your explanation is, that doesn't explain why the stylesheet get picked up if the $body variable is short and not when it is long.

    CountZero

    "If you have four groups working on a compiler, you'll get a 4-pass compiler." - Conway's Law

Re^2: Style Sheet Doesn't Display Styles
by JaredHess (Acolyte) on Jul 19, 2006 at 20:37 UTC

    jdtoronto, thanks for replying.

    I'm not sure if that's it, because it is finding the sheet sometimes.

    In any case, I tried doing it with the initial slash (also tried an absolute pathway pointing to the .css), but neither improved performance.

    I thought it might be a local webserver thing, so I uploaded it and the style sheet to our production server and get the same result.

      One thing I noticed is that you don't close your <link> tag. Closing link tags is NOT optional in HTML. just re-read the specs, and in fact you're not allowed to use a closing link tag. please ignore

      Another possibility is that your server isn't sending out the correct content-type header for the css.

      In any case it's more likely an HTML/browser/server problem than a perl question :-)

        Update: He corrected himself when I was writting my post. Ignore this post.

        No, the closing tag is optional (in HTML 4.01). Note the "O" for "Optional":

        <!ELEMENT LINK - O EMPTY -- a media-independent link --> <!ATTLIST LINK %attrs; -- %coreattrs, %i18n, %events - +- charset %Charset; #IMPLIED -- char encoding of linked reso +urce -- href %URI; #IMPLIED -- URI for linked resource -- hreflang %LanguageCode; #IMPLIED -- language code -- type %ContentType; #IMPLIED -- advisory content type -- rel %LinkTypes; #IMPLIED -- forward link types -- rev %LinkTypes; #IMPLIED -- reverse link types -- media %MediaDesc; #IMPLIED -- for rendering on these media + -- >
        Thanks Joost,

        If this is indeed the case, how would I check it (not familiar with this... this is the first time I've tried to use style sheets in my perl scripts) and how would I correct it?