i have css files: main.css
h1 {
color: red;
}
index.html
<!DOCTYPE html>
<html xmlns:th="http://www.thymeleaf.org">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<title>Drink Shop</title>
<link rel="stylesheet" type="text/css" th:href="@{/css/main.css}"/>
</head>
<body>
<h1>Wellcome</h1>
</body>
</html>
everything looks good, but the red color of h1 text: wellcome does not show up I using thymeleaf, spring boot. Maybe I should add some dependence in pom.xml?
hierarchy
试试这个
<link rel="stylesheet" href="../css/main.css" th:href="@{/css/main.css}" type="text/css"/>
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.