[Answer]-Django serving static images defined inside CSS file

1👍

Well you’re problem has nothing to do with Django and that’s a good thing. It’s simply the path to your images is not being served correctly by your CSS file.

If you have something like this folder structure;

static
    images
        banner2.png
    css
        main.css
    js

In order for your css to find your image assuming that is the folder structure you need to move back one folder so the url to your image inside your css file would look like this;

.outer_banner
{
    background:url(../images/banner2.png) bottom center no-repeat;
    padding:300px 0;
}

Leave a comment