<!DOCTYPE html>
<html lang="en" xmlns:th="http://www.thymeleaf.org">
<body>
<header th:fragment="header(h1,p)">
<div class="text-center text-white">
<h1 class="display-4 fw-bolder" th:text="${h1}"></h1>
<p class="lead fw-normal text-white-50 mb-0" th:text="${p}"></p>
</div>
</header>
</body>
</html>
다른 html에 header 적용 방법
<!-- Header-->
<header th:replace="layout/header::header(h1='Welcome', p='') "></header>
header 말고도 다른 레이아웃에 변수 추가하려면 이렇게 하면 되겠지 ?!?!