Beefy Boxes and Bandwidth Generously Provided by pair Networks
The stupid question is the question not asked
 
PerlMonks  

Re^2: Style Sheet Doesn't Display Styles

by JaredHess (Acolyte)
on Jul 19, 2006 at 20:37 UTC ( [id://562417]=note: print w/replies, xml ) Need Help??


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

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.

  • Comment on Re^2: Style Sheet Doesn't Display Styles

Replies are listed 'Best First'.
Re^3: Style Sheet Doesn't Display Styles
by Joost (Canon) on Jul 19, 2006 at 20:47 UTC
    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?

        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.

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://562417]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others having a coffee break in the Monastery: (7)
As of 2024-04-25 08:23 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found