title: How to include CSS file in Spring MVC with Thymeleaf?
body: <p>I'm building a Spring MVC application with Thymeleaf as the template language. I tried so many things but I was not able to include my CSS file in my Thymeleaf templates. What am I doing wrong?</p>
  
  <p>My project structure is as follows.</p>
  
  <pre><code>project
      src/
          main/
              java/
              resources/
      web/
          WEB-INF/
              web.xml
              dispatcher-servlet.xml
              views/
                  css/
                      bootstrap.min.css (and other css files)
                  index.html
  </code></pre>
  
  <p>And my index.html looks as follows.</p>
  
  <pre><code>&lt;!DOCTYPE html&gt;
  &lt;html lang="en" xmlns="http://www.w3.org/1999/xhtml" xmlns:th="http://www.thymeleaf.org"&gt;
  &lt;head&gt;
      &lt;meta charset="utf-8"/&gt;
      &lt;meta http-equiv="X-UA-Compatible" content="IE=edge"/&gt;
      &lt;meta name="viewport" content="width=device-width, initial-scale=1"/&gt;
      &lt;meta name="description" content=""/&gt;
      &lt;meta name="author" content=""/&gt;
      &lt;title&gt;Hello Spring MVC&lt;/title&gt;
      &lt;link th:href="@{/css/bootstrap.min.css}" rel="stylesheet"/&gt;
  &lt;/head&gt;
  &lt;body&gt;
  ...
  &lt;/body&gt;
  &lt;/html&gt;
  </code></pre>
  
  <p>When I run my application, the index.html is shown, but the css is not found.</p>
  
  <p>How do I need to include the css?</p>