Solved

Drupal 7 does not show images from css

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

VMware Disaster Recovery and Data Protection

In this expert guide, you’ll learn about the components of a Modern Data Center. You will use cases for the value-added capabilities of Veeam®, including combining backup and replication for VMware disaster recovery and using replication for data center migration.

Question has a verified solution.

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

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 …
Hi, in this article I'm going to teach you how to run your own site, and how to let people in (without IP). I'll talk about and explain each step... :) By the way, everything in this Tutorial is completely free and legal. This article is for …
This video demonstrates how to create an example email signature rule for a department in a company using CodeTwo Exchange Rules. The signature will be inserted beneath users' latest emails in conversations and will be displayed in users' Sent Items…
Delivering innovative fully-managed cloud services for mission-critical applications requires expertise in multiple areas plus vision and commitment. Meet a few of the people behind the quality services of Concerto.

930 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

11 Experts available now in Live!

Get 1:1 Help Now