artaxerxe
artaxerxe

Reputation: 6411

Get image in CSS and Playframework 2

Here is what I try to do:

HTML/CSS code:

<div style="display: block; background-image: url(@routes.Assets.at("/assets/images/favicon.png")));">
    <br />
    <br />
    <br />
    <br />
    <br />
    <br />
    <br />
    <br />
    <br />
</div>

The favicon.png file is located under public/images directory of Play Framework.

The problem is that this image never displays. Can you help me on this issue? How should I refer to this image from CSS and Play Framework? I tried many modifications to this, but without any result.

Upvotes: 1

Views: 668

Answers (1)

grotrianster
grotrianster

Reputation: 2468

I guess it should be like this

background-image: url('@routes.Assets.at("images/favicon.png")')

Upvotes: 3

Related Questions