in reply to Re^2: Style Sheet Doesn't Display Styles
in thread Style Sheet Doesn't Display Styles

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 :-)

Replies are listed 'Best First'.
Re^4: Style Sheet Doesn't Display Styles
by ikegami (Patriarch) on Jul 19, 2006 at 20:51 UTC

    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 + -- >
Re^4: Style Sheet Doesn't Display Styles
by JaredHess (Acolyte) on Jul 19, 2006 at 21:10 UTC
    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?

      If you have firefox with the livehttpheaders extension you can see the headers of all requests.

      you can also use the lwp-request command that comes with LWP. For example:

      lwp-request -m HEAD http://localhost/
      gives me:
      200 OK Connection: close Date: Wed, 19 Jul 2006 21:39:32 GMT Accept-Ranges: bytes ETag: "1cc17e-100e-3dba5c6e" Server: Apache/1.3.33 (Debian GNU/Linux) PHP/4.3.10-16 mod_auth_pam/1. +1.1 mod_perl/1.29 Content-Length: 4110 Content-Type: text/html; charset=iso-8859-1 Last-Modified: Sat, 26 Oct 2002 09:12:14 GMT Client-Date: Wed, 19 Jul 2006 21:39:32 GMT Client-Peer: 127.0.0.1:80 Client-Response-Num: 1
      The important part in this case is the Content-Type header. For a stylesheet it should say Content-Type: text/css optionally followed by a semi-colon and charset value - and a lwp-request <url> should give you the content of the stylesheet.

      You could also try to see if making a plain HTML page containing the output of your script gives the same problem. Trying different browsers can also be enlightening.