On Thu, 10 Oct 2002 at 22:01, Ian Watt opined:
IW:is there some special trick to linking a style sheet to your page when
IW:the page is generated by a cgi script?
IW:I have this sub routine that prints the header of a html page:
IW: sub write_html_header
IW: {
IW: print "Content-type: text/html\n\n<html>\n <head>\n";
IW: print " <link rel='stylesheet' href='mystyle.css' />\n";
IW: print " <title>$_[0]</title>\n";
IW: print "</head>\n<body>\n";
IW: }
IW:When I run this in a browser it displays the page normally except the
IW:style sheet isn't applied to the page at all. It just shows the
IW:default colors. I also tried it with the attributes "type='text/css'"
IW:and "media='screen'" but nothing seems to work. I've tried it in
[snip]
assuming your mystyle.css file is in your document root, try this:
print " <link rel='stylesheet' type='text/css' href='/mystyle.css'>\n";
because if you're trying to print this from a file in your cgi-bin, then
listing the href='mystyle.css' means 'look for the file
cgi-bin/mystyle.css', and you probably have it in your document root.
including the leading slash will tell the webserver to look there instead.
also, i'm not sure why you have the extra '/' in there, but perhaps that
is causing problems also.
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]