<!DOCTYPE html>
<html lang="zh-CN" xmlns:th="http://www.thymeleaf.org">

<div th:fragment="type_btns(typeList)" class="card" style="margin-bottom: 0;border-bottom: 1px solid rgba(0,0,0,.125);">
    <div class="card-body d-flex align-content-start flex-wrap type-box">
        <a th:each="type : ${typeList}"
           th:text="${type.name}"
           th:href="${'?type=' + type.name}"
           th:class="${'btn ' + (type.selected ? 'btn-primary' : '')}"
           th:style="${'margin: 0.5em;' + (type.selected ? 'color: #fff;' : '')}"
           style="margin: 0.1em;color: #fff;"
           class="btn btn-primary">全部</a>
    </div>
</div>

</html>