Images in CSS
Permalink
Hey,
I have one site which in the CSS references images (background etc), how do i ensure that they are found when the page is loading because currently they aren't, and using:
<?=$this->getThemePath()?>
doesn't work!
Thanks
I have one site which in the CSS references images (background etc), how do i ensure that they are found when the page is loading because currently they aren't, and using:
<?=$this->getThemePath()?>
doesn't work!
Thanks
Nope, having no luck with that :S
Any other ideas?
Thanks
Any other ideas?
Thanks
you could try that line with the echo in it, rather than just the "=", as I think some php configs might not allow that.
<?php echo $this->getThemePath(); ?>
that should work. if not, can you send a link?
<?php echo $this->getThemePath(); ?>
that should work. if not, can you send a link?
are you referring to putting that code in the css file? in that case, you would put the image url in relation to the css file. in other words, if you have a "css" folder in your theme where the css file is location, and you also have an "images" folder, you would need to specify the path as '../images/file.jpg' from the css file in order to reference a file in the images folder.
Yes i need to put the code in the CSS,
http://74.52.183.82/~armanwad/concrete5/themes/hhoe/...
that's a link to all the template files,
Thanks
Andy
http://74.52.183.82/~armanwad/concrete5/themes/hhoe/...
that's a link to all the template files,
Thanks
Andy
just start the image url with 'images/...'.
you don't need the ../ since your css file is in the root of your theme directory. in other words, it should look like this:
you don't need the ../ since your css file is in the root of your theme directory. in other words, it should look like this:
#main { background: #FFFFFF url(images/back.png) repeat-y; color: #5A6370; }
Brilliant that's sorted it, sorry my CSS isn't great!
Thanks
Andy
Thanks
Andy
I'm not sure how they managed to do this, but it appears to be working for that one so you could give it a try.