css file doesn't load from css/file.css

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • raknin
    New Member
    • Oct 2007
    • 82

    css file doesn't load from css/file.css

    Hi,

    I have a starnge behaviour if the css file exists in the same directory as the html file it is working but if I move the css file into /css directory which exists in under the html file directory the css file doesn't load, any sugesstions

    i.e.
    work

    <link rel="stylesheet " type="text/css" href="facebox.c ss" media="screen" />

    Does not work:

    <link rel="stylesheet " type="text/css" href="css/facebox.css" media="screen" />


    Are there any rules howtoinclude a css file.
  • Plater
    Recognized Expert Expert
    • Apr 2007
    • 7872

    #2
    Does making it:

    <link rel="stylesheet " type="text/css" href="./css/facebox.css" media="screen" />

    Work?
    Is the directory css or Css or CSS? Case matters sometimes.

    Comment

    • drhowarddrfine
      Recognized Expert Expert
      • Sep 2006
      • 7434

      #3
      I don't see anything wrong with what you are doing.

      Comment

      • Death Slaught
        Top Contributor
        • Aug 2007
        • 1137

        #4
        Do you have a link to a test site? If so please post it so we can help you further.

        Thanks, Death

        Comment

        • nanaveraa
          New Member
          • May 2008
          • 9

          #5
          Hello frnd,
          you'll modify the href path. Because two types of path setting is available. One is absolute. for exp. c:/css/facebox.css. Another one is relative. for exp. facebox.css. will you try first type
          Best Of Luck
          Originally posted by raknin
          Hi,

          I have a starnge behaviour if the css file exists in the same directory as the html file it is working but if I move the css file into /css directory which exists in under the html file directory the css file doesn't load, any sugesstions

          i.e.
          work

          <link rel="stylesheet " type="text/css" href="facebox.c ss" media="screen" />

          Does not work:

          <link rel="stylesheet " type="text/css" href="css/facebox.css" media="screen" />


          Are there any rules howtoinclude a css file.

          Comment

          • harshmaul
            Recognized Expert Contributor
            • Jul 2007
            • 490

            #6
            about absolute.....

            you will not be able to reference a CSS file on a local drive.... the absolute CSS you will need is going to be like http://domain.com/css/facbox.css....

            if your CSS doesn't work try using it on the page to make sure you havn't written coded it wrong.

            hope that helped!

            Comment

            • harshmaul
              Recognized Expert Contributor
              • Jul 2007
              • 490

              #7
              PS....

              you could try this.....

              <style type="text/css">
              @import 'css/facebox.css';
              </style>

              Comment

              Working...