Sami Kobbi
Sami Kobbi

Reputation: 309

background: url(images/2.png) doesn't work in style.css

background: url(images/2.png) in file style.css (located in web-app/static/styles/style.css ) cannot load picture 2.png located in web-app/static/images/2.png .I'm using spring framework

Upvotes: 0

Views: 811

Answers (2)

Sinan Bay
Sinan Bay

Reputation: 181

you do image located in web-app/static/styles/images/2.png

or

background: url(http://localhost/web-app/static/images/2.png)

where is your image location?

Upvotes: 0

cnorthfield
cnorthfield

Reputation: 3501

That implies that you image is in an images folder within your styles folder i.e. styles -> images -> 2.png

I suggest trying ../images/2.png which goes back a folder, if your images folder is inside the static folder i.e. static -> images -> 2.png

Upvotes: 2

Related Questions