Solved

Drupal 7 does not show images from css

Posted on 2013-01-18
2
439 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:
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

IT, Stop Being Called Into Every Meeting

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

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…
In Solr 4.0 it is possible to atomically (or partially) update individual fields in a document. This article will show the operations possible for atomic updating as well as setting up your Solr instance to be able to perform the actions. One major …
Excel styles will make formatting consistent and let you apply and change formatting faster. In this tutorial, you'll learn how to use Excel's built-in styles, how to modify styles, and how to create your own. You'll also learn how to use your custo…
This video shows how to remove a single email address from the Outlook 2010 Auto Suggestion memory. NOTE: For Outlook 2016 and 2013 perform the exact same steps. Open a new email: Click the New email button in Outlook. Start typing the address: …

758 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

Need Help in Real-Time?

Connect with top rated Experts

18 Experts available now in Live!

Get 1:1 Help Now