By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
459,960 Members | 1,453 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 459,960 IT Pros & Developers. It's quick & easy.

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

P: 82
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.
May 8 '08 #1
Share this Question
Share on Google+
6 Replies


Plater
Expert 5K+
P: 7,872
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.
May 8 '08 #2

drhowarddrfine
Expert 5K+
P: 7,435
I don't see anything wrong with what you are doing.
May 8 '08 #3

Death Slaught
100+
P: 1,137
Do you have a link to a test site? If so please post it so we can help you further.

Thanks, Death
May 8 '08 #4

P: 9
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
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.
May 15 '08 #5

harshmaul
Expert 100+
P: 490
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!
May 16 '08 #6

harshmaul
Expert 100+
P: 490
PS....

you could try this.....

<style type="text/css">
@import 'css/facebox.css';
</style>
May 16 '08 #7

Post your reply

Sign in to post your reply or Sign up for a free account.