in reply to Style Sheet Doesn't Display Styles

Ok... Another tidbit of information that may shed some light on this.

I changed my script to read as follows:

#!/usr/local/bin/perl print "Content-type: text/html\n\n"; my $body = "123"; my $length = length($body); my $body2 = "abc"; my $length2 = length($body2); print<<bob; <html> <head> <!-- Style Sheet Here --> <link href="./training_site.css" rel="stylesheet" type="text/css"> <title></title> </head> <body> <p class="bodytext">Body variable *$body* has $length chars</p> <p class="bodytext">Body variable *$body2* has $length2 chars</p> </body> </html> bob
Note that both $body and $body2 are short strings of three chars each. It seems that adding the $body2 into the printed html code makes it so the styles don't display as well. *scratches head* Perhaps the problem is something else and not just long strings?

Replies are listed 'Best First'.
Re^2: Style Sheet Doesn't Display Styles
by duckyd (Hermit) on Jul 19, 2006 at 21:14 UTC
    From one of your follow up posts, it sounds like you're getting the desired output (HTML) regardless of the content of the $body variable. If that's the case, this is probably not a perl issue, but a Browser/Server problem as Joost mentions

      Hi duckyd, thanks for sharing your wisdom.

      You may be correct...Except that I created a .htm page and ran it on the same server in the same folder location as the Perl script, pointing to the same css file, and it functions properly. If it is a Browser/Server problem, shouldn't that fail as well?

      Since it only fails using Perl, I suspect something perlish...

      ...but you may be right. How could I tell for sure?

Re^2: Style Sheet Doesn't Display Styles
by ikegami (Patriarch) on Jul 19, 2006 at 21:11 UTC
    Can we see your style sheet, please? If I put .bodytext { color: #F00 } in training_site.css, I see both paragraphs in red.
      Hmm. I wonder if it is a style sheet problem. I didn't even think of that. If so, why would it function in the normal .htm file but not in my Perl script though? Anwyay, here's the style sheet:
      a { color: #000099; } a:hover{ color:#33FF33; background-color:white; text-decoration:underline; } .smallred { font-family: Arial, Helvetica, sans-serif; font-size: 10px; color: #CC0000; } .smallblack { font-family: Arial, Helvetica, sans-serif; font-size: 10px; color:#000000; } .smallblackheading { font-family: Arial, Helvetica, sans-serif; font-size: 12px; color:#000000; font-weight: bold; } .smallredheading { font-family: Arial, Helvetica, sans-serif; font-size: 12px; color:#CC0000; font-weight: bold; } .h1shade { font-family: Arial, Helvetica, sans-serif; font-size: 36px; text-transform: lowercase; color: #000066; background-color: #CCCCCC; } .h2shade { font-family: Arial, Helvetica, sans-serif; font-size: 24px; text-transform: lowercase; color: #330066; background-color: #CCCCCC; } .h3shade { font-family: Arial, Helvetica, sans-serif; font-size: 18px; text-transform: lowercase; color:#990000; background-color: #CCCCCC; } .h1 { font-family: Arial, Helvetica, sans-serif; font-size: 36px; text-transform: lowercase; color: #000066; } .h2 { font-family: Arial, Helvetica, sans-serif; font-size: 24px; text-transform: lowercase; color: #330066; } .h3 { font-family: Arial, Helvetica, sans-serif; font-size: 18px; text-transform: lowercase; color:#990000; } .bar { font-family: Geneva, Arial, Helvetica, sans-serif; font-size: 24px; color: #000033; text-transform: lowercase; background-color: #FFCC00; border-style: solid; border-top-width: 3px; border-left-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-color: #333333; } .note { border-style: solid; border-top-width: 10px; border-color:#660033; } .bodytext { font-family: Arial, Helvetica, sans-serif; font-size: 10px; color:#000033 font-weight: normal; border:solid thin yellow; }

        color:#000033
        should be
        color:#000033;

        missing semicolon after

          color:#000033
        in .bodytext {

        can't help.