Solved

Drupal 7 does not show images from css

Posted on 2013-01-18
2
445 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
2 Comments
 
LVL 13

Accepted Solution

by:
Arrow_1 earned 300 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

Technology Partners: 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

Introduction As you’re probably aware the HTTP protocol offers basic / weak authentication, which in combination with the relevant configuration on your web server, provides the ability to password protect all or part of your host.  If you were not…
If you are a web developer, you would be aware of the <iframe> tag in HTML. The <iframe> stands for inline frame and is used to embed another document within the current HTML document. The embedded document could be even another website.
This is a high-level webinar that covers the history of enterprise open source database use. It addresses both the advantages companies see in using open source database technologies, as well as the fears and reservations they might have. In this…
Do you want to know how to make a graph with Microsoft Access? First, create a query with the data for the chart. Then make a blank form and add a chart control. This video also shows how to change what data is displayed on the graph as well as form…

729 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