Newbie With Zend Having Trouble Using Images in CSS file

For programming and general questions on Zend Framework

Newbie With Zend Having Trouble Using Images in CSS file

Postby shweta_parbhakar on Thu Jan 31, 2013 11:13 am

Hi

I feel pretty stupid because this is such a basic problem that I am having, but I have been having trouble with it for a few hours, so thought I'd put my problem to the community....

I added a css file and images mentioned in css files are not loading.

Code: Select all
#banner {
   width: 870px;
   height: 184px;
   margin: 0 auto;
   padding: 0;
   background: url(/public/images/img03.jpg) no-repeat left top;
}


Any help would be appreciated.

Thanks
shweta_parbhakar
 
Posts: 2
Joined: Thu Jan 31, 2013 10:41 am

Re: Newbie With Zend Having Trouble Using Images in CSS file

Postby kustome on Thu Jan 31, 2013 7:19 pm

Well, this all depends on where your CSS file is located too.

try

background: url(../public/images/img03.jpg) no-repeat left top;
kustome
 
Posts: 4
Joined: Tue Nov 06, 2012 4:19 pm

Re: Newbie With Zend Having Trouble Using Images in CSS file

Postby shweta_parbhakar on Fri Feb 01, 2013 10:29 am

thanks for your reply....
but my problem still persists. My directory structure is :

application
->configs
->controllers
->data
->forms
->layouts
->models
->views
public
->images
->scripts
->styles
->.htaccess
->index.php
......
shweta_parbhakar
 
Posts: 2
Joined: Thu Jan 31, 2013 10:41 am

Re: Newbie With Zend Having Trouble Using Images in CSS file

Postby tedtiger on Fri Feb 01, 2013 11:13 am

background: url(/images/img03.jpg) no-repeat left top;

This will work if the Webserver-Root ist set to the ZF public folder.

Thorsten
tedtiger
 
Posts: 118
Joined: Thu Mar 05, 2009 4:59 pm
Location: Germany


Return to Zend Framework

Who is online

Users browsing this forum: No registered users and 3 guests