在使用百里香时使用多个页眉,页脚

时间:2019-03-31 14:29:42

标签: java spring-boot intellij-idea thymeleaf

使用百里香叶时,我创建了单独的页眉和页脚。但是当我在另一页中使用它时,由于xmlns:th="http://www.thymeleaf.org不存在,它将在IDE中生成错误。但代码在chrome中有效。如何消除IDE中的错误?

<!DOCTYPE html >
<html xmlns:th="http://thymeleaf.org">
<head th:fragment="head">

<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<title> Data Tables</title>
<!-- Tell the browser to be responsive to screen width -->
<meta content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no" name="viewport">

<link rel="stylesheet" th:href="@{/css/bootstrap.min.css}">
<link rel="stylesheet" th:href="@{/css/buttons.bootstrap.min.css}">
<link rel="stylesheet" th:href="@{/css/font-awesome.min.css}">
<link rel="stylesheet" th:href="@{/css/dataTables.bootstrap.min.css}">
<link rel="stylesheet" th:href="@{/css/fonts.css}">
<link rel="stylesheet" th:href="@{/css/AdminLTE.min.css}">
<link rel="stylesheet" th:href="@{/css/_all-skins.min.css}">
<link rel="stylesheet" th:href="@{/css/style.css}">
</head>

header.html

    <div th:replace="fragments/head.html :: head "></div>
    <div th:replace="fragments/header.html :: header"></div>
    <div th:replace="fragments/sidenav.html :: sidenav"></div>
    <div th:replace="fragments/footer.html  :: footer"></div>

index.html

在index.html中有错误

0 个答案:

没有答案