{% extends 'base.html.twig' %} {% block localstyle %} .wrap { height: 130px; position: relative; margin: 5px; } h2.centre-line { text-align: center; position: absolute; top: 50%; left: 50%; width: 100%; transform: translate(-50%, -50%); } h2.centre-line:before { content: ""; position: absolute; width: 100%; height: 1px; top: 50%; left: 0; z-index: -1; background: gray; } h2.centre-line span { padding: 1rem; display: inline-block; background: white; } {% endblock %} {% block body %} {{ form_start(form) }}