When I use the following:
<html>
{% block head %}
<title>Hello</title>
{% endblock %}
The output in the HTML document is:
<html>
--- empty line ---
<title>Hello</title>
How can I avoid this empty line? I can use:
<html>
{% block head %}<title>Hello</title>
{% endblock %}
but that is ugly...
Thanks,
Joel
If you are concerned about saving space/kbytes you can use the {% spaceless %} template tag to get get rid of all the empty spaces between html tags. This is generally good practice. So put {% spaceless %} at the very top of your base.html and {% endspaceless %} at the very end
If you are worried about the asthetics of your code, there's not much you can do!
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With