4

Here's a part of my .php file:

<html xmlns:fb="http://www.facebook.com/2008/fbml" xmlns="http://www.w3.org/1999/xhtml">
<head>
    <meta content="IE=8" http-equiv="X-UA-Compatible">
    <meta content="en-us" http-equiv="Content-Language">
    <meta content="TEST" http-equiv="description">
    <meta content="checkin, check-in, checkins, check-ins, checking-in, recommendations, popular, social, television, tv, show, shows, movie, movies, book, books, music, celebrity, game, games, video game, video games" http-equiv="keywords">
    <title> Recommend Me: Find Me a Movie</title>
    <link href="/css/reset.css" media="screen,projection" type="text/css" rel="stylesheet"/>
    <link href="/css/home.css" media="screen,projection" type="text/css" rel="stylesheet"/>
    <link href="/css/dialog.css" media="screen,projection" type="text/css" rel="stylesheet"/>
    <link href="/css/modals.css" media="screen,projection" type="text/css" rel="stylesheet"/>
    <script type="text/javascript">var _sf_startpt=(new Date()).getTime()</script>
</head>
<body>

The file structure is here:

enter image description here

Why can't I get the page formatted as the css? Removing those links to the css made no difference at all!

2 Answers 2

3

Try removing the leading slash. The leading slash indicates that the path starts at the website's root, which might not be the "Source Files" directory.

In other words, use css/reset.css instead of /css/reset.css.

Sign up to request clarification or add additional context in comments.

3 Comments

While that could be the issue (relative paths are confused), this seems more like a guess than an answer.
@Jared Leading slashes are a very common cause for this issue, and there could be so many possible reasons his CSS isn't working given the information provided (including errant stylesheets, and stylesheets whose rules happen not to apply to any of the elements on his document.
Oh sure, I know. My whole point is, it's a guess, and maybe the answer, but you haven't explained why, or given any other issues to check. That's all I'm saying.
1

You forgot to close your <meta> tags (use <meta ... /> with the slash before the >). So a browser is allowed to ignore anything after <meta content="IE=8" http-equiv="X-UA-Compatible"> as it does not belong inside <meta> tag.

However, since browsers are usually able to understand crappy HTML, it might not be the cause of your problem. Are you sure the CSS stylesheets are loaded from the correct URL? Test if http://yourdomain/css/reset.css actually exists. You might also simply want to remove the leading slash in the stylesheet URLs.

1 Comment

Another technique would be to check in Firebug and see what URL the browser is actually seeing on the client side. Whenever I have an issue, this is usually the place I look first.

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.