0

TL;DR: My HTML isn't linking to a stylesheet.

Right off the bat, sorry for so much code.
I have checked other questions, but none had such a strange circumstance as I did.

I have a file, loggedIn.html:

<html>
        <head>
                <title>Logged in!</title>
                <link rel="stylesheet" href="cgi-bin/style.css">
        </head>

        <body>
                You are now logged in!
                <a href="cgi-bin/logout.php">Logout</a>
        </body>
</html>

Which uses the stylesheet style.css:

body { font-family: Georgia, Goudy, Sabon, serif; }

Along with loggedIn.html, index.html uses style.css:

<html>
<head>
        <title>Welcome!</title>
        <link rel="stylesheet" href="cgi-bin/style.css">
</head>

<body>
        <h2>Welcome to That Guy's Fileshare Server!</h2>
        <hr/>
        Please log in.
        <br/>

        <form action="cgi-bin/login.php" method="POST">
                <p>
                <table border="0">
                                <tr>
                                        <td> <label for="username">Username: </label> </td>
                                        <td> <input type="text" name="username"/> </td>
                                </tr>
                                <tr>
                                        <td> <label for="password">Password: </label> </td>
                                        <td> <input type="password" name="password"/> </td>
                                </tr>
                                <tr>
                                        <td> <input type="submit" value="Submit"> </td>
                                </tr>
                        </table>
                </p>
        </form>
        <br/>
        <a href="register.html">Register</a>
        <br/>
        <a href="note.html">Contact information</a>
</body>
</html>

Since both loggedIn.html and index.html use the same stylesheet, shouldn't they both be rendered in Georgia, Goudy, Sabon, or a serif font? Apparently not. The file structure is:

┌ index.html
├ loggedIn.html
└ cgi-bin/
   └─────────── style.css

The file structure shouldn't be a problem either, since both .html files are in the same directory and use href="cgi-bin/style.css". I've never had a problem like this before. Very strange!

3
  • maybe a caching issue ... did you try clearing the cache? Commented Oct 28, 2013 at 0:56
  • 7
    Apart from a seemingly rhetorical question about which font should be used, you haven't actually explained what the problem is. I'd also suggest that cgi-bin isn't the place to keep your files. Commented Oct 28, 2013 at 0:56
  • @MartinTurjak Just cleared my cache and reloaded. Not a caching issue, it's most likely server-side. Commented Oct 28, 2013 at 1:03

2 Answers 2

4

forgot your type. Also check the location of the css file. I believe leaving out the type will cause problems.

<link rel='stylesheet' type='text/css' href='cgi-bin/style.css'/>
Sign up to request clarification or add additional context in comments.

Comments

0

Or you can do

<style type="text/css"> @import "cgi-bin/style.css"; </style>

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.