回答編集履歴
1
コードを追加
answer
CHANGED
@@ -1,3 +1,10 @@
|
|
1
1
|
CSSのパスは正しいですか?
|
2
2
|
例えば、相対パス(```css/style.css```)だと、http://localhost:8080/sub/から読み込むと、読み込むファイルが```http://localhost:8080/sub/css/style.css```になります。
|
3
|
+
絶対パスにしたい場合は、先頭に"/"を入力ください。
|
4
|
+
|
5
|
+
```html
|
6
|
+
<link rel="stylesheet" href="/css/style.css">
|
7
|
+
|
8
|
+
<!-- Thymeleafの場合 -->
|
3
|
-
|
9
|
+
<link rel="stylesheet" th:href="@{/css/style.css}">
|
10
|
+
```
|