I\'m trying to use Bootstrap CSS with my Spring + Security + Thymeleaf web application. The CSS gets picked up the by my custom login screen and everything is fine - all styles
Figured it out ... schoolboy error on my part ...
The following link in my home.html file wasn't resolving to the right location:
<link href="resources/css/bootstrap-3.3.2-dist/bootstrap.min.css" rel="stylesheet" />
So instead, I used context-relative URL as follows:
<link th:href="@{/resources/css/bootstrap-3.3.2-dist/bootstrap.min.css}" rel="stylesheet" />
And this did the trick.
You code should have worked even without the Spring Expression @{}. Just include the javascript part of bootstrap which is included download zip file.
<link rel="stylesheet" href="/bootstrap-4.0.0/css/bootstrap.min.css" />
<script src="/bootstrap-4.0.0/js/bootstrap.min.js"></script>
bootstrap-4.0.0 is located in src/main/resources/static/