Tutorials References Exercises Videos Menu
Create Website Get Certified Upgrade

spaceless Template Tag


Example

Remove the space between the HTML tags:

{% spaceless %}
  <ul>
    {% for x in fruits %}
      <li>{{ x }}</li>
    {% endfor %}
  </ul>
{% 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.


Syntax

{% spaceless %}
...
{% endspaceless %}