{% if messages %}
<div class="container">
  {% for message in messages %}
  <div class="alert {% if message.tags %}alert-{{ message.tags }}"{% endif %}>
    <button type="button" class="close" data-dismiss="alert">×</button>
    {{ message }}
  </div>
  {% endfor %}
</div>
{% endif %}

{% if messages %}
<div class="container mb-3 mt-3">
  {% for message in messages %}
  <div class="alert {% if message.tags %}alert-{{ message.tags }}"{% endif %}>
    <button type="button" class="close" data-dismiss="alert">×</button>
    {{ message }}
  </div>
  {% endfor %}
</div>
{% endif %}

Add margin to site-wide message banner
Add margin to site-wide message banner