Sign In | Register Now About Bytes | Help | Site Map
Connecting Tech Pros Worldwide

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

Question posted by: raknin (Member) on May 8th, 2008 08:16 AM
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.css" 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's Avatar
Plater
Moderator
5,561 Posts
May 8th, 2008
01:48 PM
#2

Re: css file doesn't load from css/file.css
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.

Reply
drhowarddrfine's Avatar
drhowarddrfine
Expert
4,424 Posts
May 8th, 2008
01:55 PM
#3

Re: css file doesn't load from css/file.css
I don't see anything wrong with what you are doing.

Reply
Death Slaught's Avatar
Death Slaught
Site Addict
919 Posts
May 8th, 2008
08:30 PM
#4

Re: css file doesn't load from css/file.css
Do you have a link to a test site? If so please post it so we can help you further.

Thanks, Death

Reply
nanaveraa's Avatar
nanaveraa
Newbie
9 Posts
May 15th, 2008
01:27 PM
#5

Re: css file doesn't load from css/file.css
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
Quote:
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.css" 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.

Reply
harshmaul's Avatar
harshmaul
Expert
481 Posts
May 16th, 2008
08:55 AM
#6

Re: css file doesn't load from css/file.css
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!

Reply
harshmaul's Avatar
harshmaul
Expert
481 Posts
May 16th, 2008
08:56 AM
#7

Re: css file doesn't load from css/file.css
PS....

you could try this.....

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

Reply
Reply
Not the answer you were looking for? Post your question . . .
189,940 Experts ready to help you find a solution.
Sign up for a free account, or Login (if you're already a member).

Latest Articles: Read & Comment
Top HTML / CSS Forum Contributors