EllisLab text mark
Advanced Search
     
CSS: background: transparent url(/images/menu_background.gif)
Posted: 07 February 2008 06:19 PM
Joined: 2008-01-23
15 posts

I am using css for my menu as such:

.horizontal_menubar
{
    background
#000000 url(/images/menu_background.gif) top left repeat-x;

However, my images directory is under my application directory. The following code works, but there is something about having my system directory in my css file that I don’t like.

.horizontal_menubar
{
    background
#000000 url(/system/application/images/menu_background.gif) top left repeat-x;

I could also make my css file a php file and reference my images as URLs using site_url (), but that is a little bit of a hassle.

Has anyone else found a more graceful way to do this?

 
Posted: 07 February 2008 07:06 PM   [ # 1 ]   [ Rating: 0 ]
Avatar
Joined: 2007-12-03
226 posts

CSS and images should really go in your public folder (the same folder as the index.php file) rather than system.

So, you might have, for instance:

|/home/user/domains/mydomain/public_html/:
| - /
system/
| - /
images/
| - /
css/
| - /
scripts

etc…

For added security, try:

|/home/user/domains/mydomain/:
| - /
system/
| - /
public_html/
| - | - /
images/
| - | - /
css/
| - | - /
scripts

So your system folder cannot be browsed to.