0

I have tried different apporaches. For me, most logical would be the standard way, as I have it now in my "Item.html":

<html xmlns="http://www.w3.org/1999/xhtml" xmlns:th="http://www.thymeleaf.org">
<head>
    <title th:text="${item.name}"></title>
    <link href="styles.css" rel="stylesheet" type="text/css"/>
</head>

This is the form what "drag and drop" in netbeans gives me as a path.

My file structure is shown here:

enter image description here

Any ideas?

1 Answer 1

1
  1. Create a directory static in your src/main/resources/ folder.
  2. Create a directory css in created static folder to store css files.
  3. Put the css files to the css folder.
  4. In html you can include css like <link rel="stylesheet" type="text/css" th:href="@{/css/style.css}"/>

Here the static folder to serve static contents like css, js files.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.