django css url images code example
Example 1: background image css django
#third{
background: url("/static/img/sample.jpeg") 50% 0 no-repeat fixed;
color: white;
height: 650px;
padding: 100px 0 0 0;
}
Example 2: reference images from css in django
For HTML
<link rel="stylesheet" href="{% static 'app_name/css/document.css' %}">
for CSS
background: url("../img/image_name.jpeg");
for JS
document.write('<img src="{% static "images/anotherImage.png" %}" width="680" height="210" />');