473,765 Members | 2,070 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

How can a css in a folder read a pics in another folder

I have css in a folder name css. so how can this .css file read a pics file
from another folder eg, pics/a.jpg.

Both css folder and pics folder are located in a folder named project.

I know i can call the pic by url(project/pic/a.jpg)

However, its very inconveninet when I change the folder name eg from project
to project10.

so, are there any other way to do this?

Please advice. Thanks!

Jul 20 '05 #1
4 15071
/Jorntk/:
I have css in a folder name css. so how can this .css file read a pics file
from another folder eg, pics/a.jpg.

Both css folder and pics folder are located in a folder named project.

I know i can call the pic by url(project/pic/a.jpg)
If the above statement is placed in a "project/css/the.css" file
(for example) the URI for the "a.jpg" would resolve to
"project/css/project/pic/a.jpg". You should use 'url(../pic/a.jpg)'
if you have:

project/
css/the.css
pic/a.jpg

<http://www.w3.org/TR/CSS21/syndata.html#ur i>:
For CSS style sheets, the base URI is that of the style sheet, not
that of the source document.


--
Stanimir
Jul 20 '05 #2
Jorntk wrote:
I have css in a folder name css. so how can this .css file read a
pics file from another folder eg, pics/a.jpg.

Both css folder and pics folder are located in a folder named
project.

I know i can call the pic by url(project/pic/a.jpg)
ITYM, url("/project/pic/a.jpg")
However, its very inconveninet when I change the folder name eg from
project to project10.
In order:

(a) don't change sub directory ("folder") names
(b) use server redirects
so, are there any other way to do this?


(c) put the image in the same directory ("folder") as css file

--
Brian (remove "invalid" from my address to email me)
http://www.tsmchughs.com/
Jul 20 '05 #3
Jorntk wrote:
I have css in a folder name css. so how can this .css file read a
pics file from another folder eg, pics/a.jpg.

Both css folder and pics folder are located in a folder named
project.

I know i can call the pic by url(project/pic/a.jpg)

However, its very inconveninet when I change the folder name eg from
project to project10.

so, are there any other way to do this?


I somehow missed the obvious. Given subdirectory for css

/project/

and subdirectory for images

/project/pic/

use a relative url.

body {
background-image: url("pic/a.jpg");
}

This means, look for "a.jpg" in the subdirectory of whatever directory
has the css file.

(It's still better not to rename things; there are often things you
forget somewhere else in the site that will no longer find files because
of name changes.)

--
Brian (remove "invalid" from my address to email me)
http://www.tsmchughs.com/
Jul 20 '05 #4
Tim
On Sat, 1 May 2004 19:28:13 -0700,
"Jorntk" <jo****@yahoo.c om> posted:
I have css in a folder name css. so how can this .css file read a pics file
from another folder eg, pics/a.jpg.

Both css folder and pics folder are located in a folder named project.

I know i can call the pic by url(project/pic/a.jpg)

However, its very inconveninet when I change the folder name eg from project
to project10.


Two ways:

1. Use relative links. Back out of a folder using ../ into the parent, the
append the new name onto the end of it.

e.g. Given some files located at:

/an/example/here.test
/an/other/example.test

The first one (here.test) could refer to the second (example.test)
with a link like "../other/example.test".

2. Use absolute links. All links include the full path to the destination,
starting with a slash / to indicate the root.

e.g. Given those same files as before, they'd each have links using the
full path to the other. The first would refer to the second with a link
like "/an/other/example.test".

Depending on what you mean by changing a folder name, you're in for a hard
time. If you rename things, you've got to make quite a lot of changes on
anything else that referred to it.

--
If you insist on e-mailing me, use the reply-to address (it's real but
temporary). But please reply to the group, like you're supposed to.

This message was sent without a virus, please delete some files yourself.
Jul 20 '05 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
992
by: RS | last post by:
Is there a way to debug a C style DLL from another folder other than the usual debug folder. I have some 3rd party software that I want to interface with, and this software looks for a folder called Plugins. It will open all of the DLL's contained in that Plugins folder and begin executing code. I want to debug my personal plugin DLL from that folder. How can I do that ?
35
2306
by: Shyguy | last post by:
Is it possible, and if so how would I read and import folder names from a CD to a table? Thank you for any help.
0
986
by: Siew-Ming | last post by:
Hi, Try to figure a way to turn off a folder Read-only property for a specific folder (Windows 2003) at multi sites. When we do our application upgrade/patch, we manually turn off the Read-only for entire folder in order to load the new files then set it back Read-only after installing upgrade/patch. Learned VB.net before and have Visual Studio 2003. Can someone shed some lights? I wil greatly appreciate that.
6
13358
by: ad | last post by:
I want to copy all files under a folder to another folder. If I use File.Copy(sourceFileName, destFileName, overwrite), it must specify all files name in the source and destionation. How can I copy all files in a directoy to another directory?
2
10695
by: Bill Fallon | last post by:
I have a VS2005 VB.Net windows form application deployed to a share drive. The windows explorer security permissions for this application (.exe) file is set for Everyone with List Folder/Read Data not allowed. This is done so that users cannot take away a copy of the .exe file. When I execute the ..exe from the client computer I get .Net Framework Initialization Error, Unable to find a version of the runtime to run this application. The...
8
3872
by: paquer | last post by:
Database Users need to have Read/Write etc... permissions to the folder where the Database resides in order to create the lock file. I have read only users. I have set up the Shortcut that links to the 'Workgroup Info File' with permissions for said database. Within this 'WIF' File I have "Read Only" user's who are only provided access to the DB only so they can view the data. Now if I give them full permissions to the folder where...
5
3578
by: wassimdaccache | last post by:
Hyyy I do have a database that I saved on c:\wasspro\mydb in the folder wasspro I have another folder called image . what i need is to copy folder wasspro into another directory d:\backup I tried to make a file using the notepad and I saved the file as test.bat c:
2
1810
by: cpet | last post by:
Is it possible to have Access 2003 put the ldb in a different folder that the mdb is in? Thus allowing users Read-only access to the data without having to set up database security.
2
1785
by: swethak | last post by:
hi, i want to copy the contents of one folder into another folder.For that i create the one new folder . I copied the files of already existing folder into new folder.For that i write a code as <?php mkdir("filesscreate",0777); copy('admin','filescreate'); ?>
0
9568
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9398
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10156
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10007
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
8831
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
6649
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5419
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
3531
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2805
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.