# Need CSS to access path on hard drive



## Cyborg Ninja (Jan 25, 2008)

I need to use my background image attribute to load an image from my hard drive. I've tried something like this:
background-image: url('file:///C:/Icons/firefox.jpg');
but it isn't working. What do I do? The stylesheet is not located in the same directory as the image and I don't want it to.


----------



## KoosHopeloos (Nov 3, 2004)

@ Cyborg Ninja: it seems that the reference you use is not correct: see here.

So you should change your url ot something like url('../Icons/firefox.jpg');


----------



## Cyborg Ninja (Jan 25, 2008)

Link didn't really help and I think you just gave another way of accomplishing the same thing depending on where you are located, but instead by switching directories with ".." In the end, I think my way works, but I need to restart the application or the cache, according to another site.


----------



## KoosHopeloos (Nov 3, 2004)

@ Cyborg Ninja: Put your webpage to be online and make the reference to the image as I suggested (perhaps you need to create a folder "Icon", watch the capital I). You'll see that it works!


----------



## Cyborg Ninja (Jan 25, 2008)

KoosHopeloos, many people would consider your comment offensive and condescending. You apparently do not understand a reason to access files on a hard drive through CSS: does that make it impossible? Does that make the person who wishes to do this an idiot who doesn't know the differences between a hard drive and a server? Answer those questions in your own head. I hope you will realize how to read into a situation better if you try to give advice again.


----------



## Bisque (Feb 3, 2008)

1.Cyborg, maybe koos did not understand what exactly you were meaning to do (i dont know) but i do not think his comment/advice was in any way rude or condescending. When someoen tries to help you there is no reason to act so hostily when they do not understand what it is you are asking.

2.Koos' suggestion was pretty much right (first post). If the files are in different directories you need to take the link back to the parent directory first. It shouldn't really matter if you're doing this for internet or just for computer use.

Would this maybe help?

It does reffer to online urls but it is essentially the same idea as all urls are ofcourse in refference to files on a server or computer..somewhere haha


----------



## KoosHopeloos (Nov 3, 2004)

@ Cyborg Ninja: I'm sorry that you took my post offensive and condescending. It was not intented like Bisque already explained to you. I gave the suggestion to put on a server, since (as Bisque also told you) it works the same for a computer and a server.

Did Bisque's link help you? Did "I need to restart the application or the cache, according to another site" work?


----------



## Inactive (Apr 11, 2005)

Cyborg Ninja said:


> KoosHopeloos, many people would consider your comment offensive and condescending. You apparently do not understand a reason to access files on a hard drive through CSS: does that make it impossible? Does that make the person who wishes to do this an idiot who doesn't know the differences between a hard drive and a server? Answer those questions in your own head. I hope you will realize how to read into a situation better if you try to give advice again.


cyborg ninja english is not the first language of all people here so sometimes translations can seem somewhat direct. you are welcome to receive help, but you are not welcome to intentionally insult others. if you persist i'll close this thread.


----------

