+ Reply to Thread
Results 1 to 3 of 3

Thread: External stylesheet stopped working suddenly?

  1. #1
    meithan is offline x10Hosting Member meithan is an unknown quantity at this point
    Join Date
    Nov 2009
    Posts
    13

    External stylesheet stopped working suddenly?

    Hi.

    I use an external stylesheet to control the apprearance of some site-wide things. One week ago it worked just fine, but for the past couple days the pages are simply not picking up the stylesheet. I don't remember changing anything.

    Here's my stylesheet, located in cgi-bin/styles.css

    Code:
    body {
    	background-color: rgb(245, 245, 220);
    }
    
    table.main {
    	border-width: 1px;
    	border-spacing: 0px;
    	border-style: solid;
    	border-color: white;
    }
    table.main td {
    	border-width: 1px;
    	border-spacing: 0px;
    	border-style: solid;
    	border-color: white;
    	padding: 4px;
    	background-color: rgb(255, 255, 240);
    }
    table.main tr.header td {
    	background-color: rgb(255, 255, 102);
    }
    table.main tr.r0 td {
    	background-color: rgb(242, 242, 242);
    }
    table.main tr.r1 td {
    	background-color: rgb(231, 231, 231);
    In the HTML files i'm using the following:
    HTML Code:
    <head>
    <link rel="stylesheet" type="text/css" href="cgi-bin/styles.css">
    </head>
    The background of every page should be pale yellow, and tables should have the formatting specified.

    I wrote this simple test HTML file and it doesn't pick up the styles either:

    HTML Code:
    <html>
    <head>
    <link rel="stylesheet" type="text/css" href="cgi-bin/styles.css">
    </head>
    <body>
    The background should be pale yellow!
    </body>
    </html>
    What am I doing wrong? What perplexes me is that it worked just fine last week.

    Thanks.
    Last edited by meithan; 07-06-2010 at 05:06 PM.

  2. #2
    lemon-tree's Avatar
    lemon-tree is offline x10 Minion lemon-tree has a spectacular aura about
    Join Date
    Nov 2007
    Posts
    1,420

    Re: External stylesheet stopped working suddenly?

    Style sheets shouldn't really be located in the cgi-bin folder, but it shouldn't stop them from working though. Try changing
    href="cgi-bin/styles.css"
    to
    href="/cgi-bin/styles.css"

  3. #3
    meithan is offline x10Hosting Member meithan is an unknown quantity at this point
    Join Date
    Nov 2009
    Posts
    13

    Re: External stylesheet stopped working suddenly?

    Thanks, lemon-tree. I tried your suggestion but it still wouldn't work. Then I tried moving the stylesheet to the webroot, where the website html files reside. That worked.

    One weird thing is that I had to use a relative path of "../styles.css" in the scripts. My website's index.html contains a two-frame frameset. One frame is a fixed html file, but the other is produced by calling a script (in /cgi-bin) which dynamically generates the HTML code for the second frame. What is weird is that, while the script runs in /cgi-bin (and thus "../styles.css" is correct from that viewpoint), the HTML code it generates will ultimately be located in the same place as index.html, the webroot. The script doesn't use the stylesheet of course, it simply outputs the corresponding HTML tagline. Any insight on what's going on there?

+ Reply to Thread

Similar Threads

  1. Linking External Stylesheet in table cell
    By emailtoarpit in forum Graphics & Webdesign
    Replies: 6
    Last Post: 08-27-2009, 12:53 AM
  2. fedora8+wifi+dhcp not working suddenly
    By hopper in forum Computers & Technology
    Replies: 0
    Last Post: 04-18-2008, 09:04 AM
  3. SSI suddenly stopped working?
    By wombatsfan in forum Free Hosting
    Replies: 9
    Last Post: 09-06-2007, 02:05 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
x10hosting free hosting for the masses
dedicated servers