Skip to content Skip to sidebar Skip to footer

How Do I Put A Background Image On The Body In Css With Django Using Static?

How do I put a background image on the body in css with django using static? Is it something like this? I can't find any information on this. Thanks. {% load static %} body { p

Solution 1:

Use a relative path. Relative to the folder where the css file reside.

background: url('../assets/images/2.gif');

And use it in template file like this:

{% load staticfiles %}
<link href="{% static 'css_file_address' %}" rel="stylesheet" media="screen">

Post a Comment for "How Do I Put A Background Image On The Body In Css With Django Using Static?"