Reputation: 4371
I am developing web pages in django.So i have one image,i am trying to keep that images as background images for 3 pages.I kept my image in one page,but i am not able to set any option or any other form field.If i am doing some thing,the contents are getting applied above or below that image.
1) Is it possible to set an image as background of the page.(background should be applicable in main content,header and footer i already set).
2) How to implement that in my web site.
template is
{% extends "incident/base_report.html" %}
{% block main-content-a %}
<p><img src="{{ STATIC_URL }}images/Screenshot.png" /></p>
<div id="save-spreadsheet">
<form action="{% url incident.views.report_add %}" method="post">
{% csrf_token %}
{% include "buttons/cancel.html" %}
</div>
{% endblock %}
I placed the image in the above template looks like.
Upvotes: 0
Views: 760
Reputation: 53326
What you can do is create another sub block in base template and set background for the parent block. Each page will modify contents of sub-block but not the background.
E.g.
incident/base_report.html
...
{% block main-content-parent %}
{# code to set background image #}
{% block main-content %}
{%endblock%}
{%endblock%}
somepage_template.html
{% extends "incident/base_report.html" %}
{%block main-content %}
{# your content #}
{%endblock%}
Upvotes: 1