I'm struggling to incorporate a static file into my CSS as a background image for my website. The static URL is functioning properly when tested in HTML, but it's not working when implemented in CSS.
HTML:
{% extends 'base.html' %}
{% block body %}
<div class ='splash'>
<a href="{{ STATIC_URL }}background.JPG"> check me out </a>
</div>
{% endblock body %}
CSS:
.splash{
background-image: url("{{ STATIC_URL }}background.JPG");
background-size: 100%;
height: 1000px;
}
NOT WORKING
TEST CSS:
.splash {
background-image: url("http://127.0.0.1:8000/static/background.JPG");
background-size: 100%;
height: 1000px;
}
WORKING
Any suggestions on how to get the static URL to function properly?