CSS not working! HELP PLEASE..........

11 replies
  • WEB DESIGN
  • |
Hey warriors.

I'm busy building a website. I've just finished and tried to link to the style sheet.

I'm linking to the style sheet like this:

<head>
<link href="styles.css" type="text/css"
rel="stylesheet" />
</head>

It's not working though. Any advice???:confused:
#css #working
  • Profile picture of the author jimbob
    Is the stylesheet on the server? Have you pressed CTRL+F5 to hard-refresh the browser? Is there an issue with the stylesheet itself?

    It's a difficult question to answer without more details.
    Signature

    James Simpson

    {{ DiscussionBoard.errors[213897].message }}
  • Profile picture of the author GoldReaper
    Nothings hosted yet, but i compared it to a template and everything is exactly the same, but mines not working.

    Do the files have to be hosted for it to take effect, because the template I compared it to isn't hosted.
    {{ DiscussionBoard.errors[213904].message }}
  • Profile picture of the author Mantero Cantrow
    the "styles.css" file needs to be in the same directory as ur index file. try to check it
    {{ DiscussionBoard.errors[213912].message }}
  • Profile picture of the author GoldReaper
    yeah it's in the same directory.

    Let me explain everything I've done:

    -I've created my stylesheet and saved it as "styles.css"
    -I've created my site and linked to the stylesheet in the <head> tag like this:
    <link href="css/styles.css" rel="stylesheet"
    type="text/css">
    (the bold part is like that because it's a semi folder | I've tried putting it the same folder as the index as well, but it doesn't work.)

    -When I open the site, no CSS changes have taken effect.

    Ehat's puzzling me is that I checked another website template where the CSS is working, and mine is identical to that. I really don't get it.

    Any suggestions are welcome. I've been trying for almost 2 hours.
    {{ DiscussionBoard.errors[213932].message }}
  • Profile picture of the author Mantero Cantrow
    To used the css, you need to know about the selector you used, I mean you had already assigned your html tag(div,etc) with the same id as in your css.

    I would suggest you tried to upload it on the server, so then we can check it for you
    {{ DiscussionBoard.errors[213993].message }}
  • Profile picture of the author jimbob
    Did you try CTRL+F5?
    Signature

    James Simpson

    {{ DiscussionBoard.errors[214036].message }}
  • Profile picture of the author GoldReaper
    Thanks for your help guys.

    I'll upload it tomorrow sometime so you can have a look.
    {{ DiscussionBoard.errors[214265].message }}
  • Profile picture of the author Aaron H
    Just my 2 cents but are you missing a { or a } somewhere near the top of your CSS sheet, if you're certain you're pointing to the right place this could be the problem as missing a bracket symbol can cancel out all the CSS styling below that point.
    {{ DiscussionBoard.errors[214552].message }}
  • Profile picture of the author Lloyd Buchinski
    On your own computer, you just need the .css sheet in the same
    folder as all the .html pages that it controls. If you are trying to
    use the link css/styles.css and the style sheet is named styles.css
    that would certainly be a problem. (And I don't see how that would
    work.)

    If the names and the navigation are correct, some of the details
    like the one Aaron mentioned really can screw things up.

    "Oh well" I always say about code problems, "my whole life is like
    that, why not yours?" (I'm not serious.)

    Best wishes, and good luck with that. I've just been frying with a
    css problem for quite a few hours and came here for a bit of a break,
    but I'll post that in another thread.
    Signature

    Do something spectacular; be fulfilled. Then you can be your own hero. Prem Rawat

    The KimW WSO

    {{ DiscussionBoard.errors[214918].message }}
  • Profile picture of the author GoldReaper
    Hey guys!

    What a relief.

    It suddenly just started working. I don't know if I fixed something by accident, or if there was a glitch.

    Anyway, I'm happy. And now I'm almost a CSS pro. LOL still very slow though.

    I'll post my website up here so you can all look at my brilliant work.

    Haha, I'm just so stoked. It took almost 5 hours to work.
    {{ DiscussionBoard.errors[214959].message }}
  • Profile picture of the author Mantero Cantrow
    Congratz for successful fixing those up!
    {{ DiscussionBoard.errors[215748].message }}

Trending Topics