Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

Drupal 7 does not show images from css

Posted on 2013-01-18
2
Medium Priority
?
451 Views
Last Modified: 2013-01-18
Dear Experts,

I have drupal 7 website installed on a local MAMP server. For some reason the images from pages.css file don´t show up.

For example, my images are store in:
/Users/Me/Documents/Web/MySites/WebTest/drupal/sites/all/themes/webest/images/logo.png

From the css file, this is how I call the image:

background: url("/sites/all/themes/webtest/images/logo.png") no-repeat scroll 0 0 transparent;

I´ve tried also using absolute path but it does not work either.

Could you please help me?

Thanks,

Winter
0
Comment
Question by:glepiza
2 Comments
 
LVL 13

Accepted Solution

by:
Aaron Feledy earned 1200 total points
ID: 38793989
I imagine your url looks something like this when viewing your site locally:
http://localhost/WebTest/drupal

Open in new window

In which case your css would be:
background: url("/WebTest/drupal/sites/all/themes/webtest/images/logo.png") no-repeat scroll 0 0 transparent;

Open in new window


But generally you'd want to use a path relative to your css file. For example if your css file is located in:

/Users/Me/Documents/Web/MySites/WebTest/drupal/sites/all/themes/webest/css/style.css

You would want your css to be:
background: url("../images/logo.png") no-repeat scroll 0 0 transparent;

Open in new window

0
 

Author Closing Comment

by:glepiza
ID: 38794565
Thanks!!, you were totally right!
0

Featured Post

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

As Wikipedia explains 'robots.txt' as -- the robot exclusion standard, also known as the Robots Exclusion Protocol or robots.txt protocol, is a convention to prevent cooperating web spiders and other web robots from accessing all or part of a websit…
RTL (right to left) web applications aiming for audiences speaking languages like Hebrew or Arabic, are generally more complicated than the same applications aiming for audiences speaking Latin based languages. The main difference lies of course …
this video summaries big data hadoop online training demo (http://onlineitguru.com/big-data-hadoop-online-training-placement.html) , and covers basics in big data hadoop .
Loops Section Overview
Suggested Courses
Course of the Month8 days, 8 hours left to enroll

876 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question