/    Sign up×
Community /Pin to ProfileBookmark

css and conditional image

Hi,

i would like to have a CSS file that i could use for several PHP pages located into several folder.

however, as the depth of each php page could be different, i would like to know if it is possible to have a conditional CSS content ?

for example i have the following php pages :

[url]www.mywebsite.com/index.php[/url]
[url]www.mywebsite.com/company/aboutcompany.php[/url]

something like :
index.php
/company/aboutcompany.php
/css/mycssfile.css
/images/img1.gif
/images/img2.gif

if my css file has some images like background-image features.
how is it possible to make those images displayed correctly on both php page ?

for now, due to php page “folder depth” only one works.
something like
#myidtag
{
background-image : url(images/img1.gif);
}

will work perfectly for index.php but not for aboutcompany.php 🙁

thanks for help.

M

to post a comment
CSS

1 Comments(s)

Copy linkTweet thisAlerts:
@ray326Jan 06.2008 — Generate that part of your CSS with PHP on the fly.
×

Success!

Help @alain spread the word by sharing this article on Twitter...

Tweet This
Sign in
Forgot password?
Sign in with TwitchSign in with GithubCreate Account
about: ({
version: 0.1.9 BETA 5.20,
whats_new: community page,
up_next: more Davinci•003 tasks,
coming_soon: events calendar,
social: @webDeveloperHQ
});

legal: ({
terms: of use,
privacy: policy
});
changelog: (
version: 0.1.9,
notes: added community page

version: 0.1.8,
notes: added Davinci•003

version: 0.1.7,
notes: upvote answers to bounties

version: 0.1.6,
notes: article editor refresh
)...
recent_tips: (
tipper: @AriseFacilitySolutions09,
tipped: article
amount: 1000 SATS,

tipper: @Yussuf4331,
tipped: article
amount: 1000 SATS,

tipper: @darkwebsites540,
tipped: article
amount: 10 SATS,
)...