Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#1 2009-06-09 20:36:44

toastyghost
New Member
Registered: 2009-06-09
Posts: 3

Shorthand background CSS doesn't seem to work

It seems like anywhere I use CSS shorthand, like “background:transparent url(images/my_image.png) no-repeat 0 0;”, my background images don’t show up.

So you can see what I’m talking about, I took two screenshots. The first is the original layout in XHTML/CSS:
http://img196.imageshack.us/img196/3158/originalivq.jpg

And the second is what it looks like after it’s been copied into a Textpattern template:
http://img196.imageshack.us/img196/7656/textpattern.jpg

What gives? Newbie mistake on my part? Limitation of TXP? Is there a workaround?

Offline

#2 2009-06-09 20:40:46

Bloke
Developer
From: Leeds, UK
Registered: 2006-01-29
Posts: 11,391
Website GitHub

Re: Shorthand background CSS doesn't seem to work

toastyghost wrote:

“background:transparent url(images/my_image.png) no-repeat 0 0;”, my background images don’t show up.

I doubt it’s TXP because it’ll serve whatever CSS you give it. Chances are it’ll probably be a path issue. Have you tried background:transparent url(/images/my_image.png) no-repeat 0 0, i.e. with a preceding slash? Might be worth a shot.


The smd plugin menagerie — for when you need one more gribble of power from Textpattern. Bleeding-edge code available on GitHub.

Txp Builders – finely-crafted code, design and Txp

Offline

#3 2009-06-09 20:49:46

toastyghost
New Member
Registered: 2009-06-09
Posts: 3

Re: Shorthand background CSS doesn't seem to work

The slash doesn’t work, but giving it a full URL to the image does. Is there a way around that? This thing is currently living on my local XAMPP, will probably go onto a test server, then the production server when the client signs off on it, all of which have different URL’s. It’s not a huge pain to change it each time it moves, but it seems weird not to be able to use relative paths.

Offline

#4 2009-06-09 20:57:57

Bloke
Developer
From: Leeds, UK
Registered: 2006-01-29
Posts: 11,391
Website GitHub

Re: Shorthand background CSS doesn't seem to work

toastyghost wrote:

it seems weird not to be able to use relative paths.

Yes it does seem odd. I use relative paths all the time and it works fine for me on my test servers. *ponder*. If it’s not some obscure XAMPP setting (I’ve never used it so I can’t advise here) or a configuration thing inside TXP then I’m fresh out of ideas, sorry. Anyone else seen this kind of thing?


The smd plugin menagerie — for when you need one more gribble of power from Textpattern. Bleeding-edge code available on GitHub.

Txp Builders – finely-crafted code, design and Txp

Offline

#5 2009-06-09 21:29:25

els
Moderator
From: The Netherlands
Registered: 2004-06-06
Posts: 7,458

Re: Shorthand background CSS doesn't seem to work

Have you tried ../images/my_image.png?

I’ve also had to add/remove slashes and/or dots when moving sites from local to remote or vice versa, don’t know why it makes a difference, but it’s the first thing I check after moving it: are the images still visible? ;)

Offline

#6 2009-06-10 13:29:08

toastyghost
New Member
Registered: 2009-06-09
Posts: 3

Re: Shorthand background CSS doesn't seem to work

That did the trick, Els. I guess the generated stylesheet is considered to be in the same folder as the php file that generates it. Thanks!

Offline

Board footer

Powered by FluxBB