Learner's avatar

laravell css images not picking

in blade file css files not show, while directory structure is

public
--assets
------css
style.css i.e background: url(../assets/images/map.png) no-repeat 0 125px;
------images
all images

The images upload had a white space in the blade file, that's seems to be the problem! ?

0 likes
5 replies
SachinAgarwal's avatar

@itsoft this

background: url(../assets/images/map.png) no-repeat 0 125px; 

should be like this:

background: url(../images/map.png) no-repeat 0 125px; 
SachinAgarwal's avatar
Level 21

@itsoft its not laravel. Its how you normally access directories.
You said your dir structure is like this:

public 
--assets 
------css 
style.css 
------images 

Now

When you access your css, You are here:

public/assets/css/

If you do ../ at this place it will take you to:

public/assets/

That means in this line:

background: url(../assets/images/map.png) no-repeat 0 125px; 

Notice ../assets/. What you are trying to do it this:

public/assets/assets

As you are already in assets dir with ../
So if you want to access images you simply do ../images
I hope it explains well.

Please or to participate in this conversation.