# Whitespace

In Liquid you can add a hyphen to the tag syntax {{-, -}}, {%- and -%} to strip whitespace on the left or right side of a rendered tag.

In Liquid you can add a hyphen to the tag syntax `{{-`, `-}}`, `{%-` and `-%}` to strip whitespace on the left or right side of a rendered tag.

Normally every Liquid line in a template outputs an empty line in the rendered HTML, even if it outputs no text:

```liquid
Order summary:

{% if customer %}
Welcome back, {{ customer.first_name }}
{% endif %}
```

The rendered template contains two empty lines:

```text
Order summary:


Welcome back, Anna

```

Adding hyphens to the Liquid tags (`{%-` and `-%}`) removes the generated whitespace:

```liquid
Order summary:

{%- if customer -%}
Welcome back, {{ customer.first_name }}
{%- endif -%}
```

```text
Order summary:
Welcome back, Anna
```

If you only need to control whitespace on one side of a tag, add the hyphen only to the opening or the closing delimiter. In this example, the closing delimiter around `customer.name` has a hyphen:

```liquid
Hello, {{ customer.name -}}  !
```

```text
Hello, Anna!
```
