Jump to content
Sign in to follow this  
gyoery

CSS relative links

Recommended Posts

gyoery

Ok, once again I encountered a question. When I'm using css references (to background images) I'm using relative links, as the domain might still be subject to change. This works great on all level 1 pages (wordpress/level1/) but doesnt work on the blogpage (wordpress/) or on level2 pages (wordpress/level1/level2/) I have the same problem when it comes to loading the css file itsself, as it works for level 1, but not for level2 or level0 (blog) I understand why this is, I just want to know if there is a solution without using absolute links.

Share this post


Link to post
Share on other sites
Danny
Hi, What do you mean when you say [i][quote]"I have the same problem when it comes to loading the css file itsself"[/quote][/i] What CSS file are you referring too ?

Please search our forums, before posting!

Share this post


Link to post
Share on other sites
gyoery
to my own custom css. I implemented a css chooser, which selects the css from: "../wp-content/themes/pagelines/custom/css/"..... ..theme1.css ..theme2.css ..theme3.css it works great, except on the main page, where it should be refferenced as wp-content/themes/pagelines/custom/css/ (without the "../") and on nested pages where it should be "../../wp-content/themes/pagelines/custom/css/" I know it would work if I write the full path: "http://wp10987297.wp224.webpack.hosteurope.de/wordpress/wp-content/themes/pagelines/custom/css/" but I wanted to avoid that because the domain is still subject to change. This is the same for background images defined within the css. Any ideas?

Share this post


Link to post
Share on other sites
Danny
Partial URLs are interpreted relative to the source of the style sheet, not relative to the document/image etc... I'm not entirely sure as to why it wouldn't be working on your main page. However, I have little experience with what you're trying to do. Hopefully another PageLines mod can assist you further, I apologise I couldn't help you further. Have you tried searching google to see if there are similar forum topics, posts anywhere that may assist you?

Please search our forums, before posting!

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this  

×