Tutorials References Exercises Sign Up Menu
Create Website Get Certified Pro

spaceless Template Tag


Remove the space between the HTML tags:

{% spaceless %}
    {% for x in fruits %}
      <li>{{ x }}</li>
    {% endfor %}
{% endspaceless %}
Run Example »

Definition and Usage

The spaceless tag is used to remove any space between tags, in the code.

The spaceless tag removes any whitespaces, new lines and tabs.


{% spaceless %}
{% endspaceless %}