My folder structure
ProjectName
src/main/java
src/main/resources
static
css
styles.css
main.css
js
...
templates
All my html files are in the folder templates
My HTML file head
<!DOCTYPE html>
<html lang="en" xmlns:th="http://www.thymeleaf.org">
...
<link rel="stylesheet" href="../static/css/main.css" />
<link rel="stylesheet" href="../static/css/styles.css" />
I do not have EnableWebMvc
in any of my Java classes
When I run this as a jar, the page comes up fine, but all the CSS is stripped. It just shows up as plain text. I've tried this in different browsers with the same result. What am I doing wrong?