2

In the html file i can access the images folder using asset function but in my css i am not able to us e images

background-image:url(../images/back.png)

{% stylesheets 'css/*' %}
<link href="{{ asset_url }}" rel="stylesheet" media="screen" />
{% endstylesheets %}

How to fix that

2 Answers 2

3

I use this:

background-image: url(/bundles/yourbundle/images/pic.png)

Works without cssrewrite filter.

Sign up to request clarification or add additional context in comments.

Comments

-1

This is something that always puzzles me as well! Anyway there is a cssrewrite assetic filter that should help you to solve this problem detecting and rewriting urls in css scripts (anyway, even using this, you may need to change urls in your css).

1 Comment

Down-voting since this answer is vague and it doesn't help solving the problem.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.