Home > front end >  SpringBoot. One file catches CSS another doesn't
SpringBoot. One file catches CSS another doesn't

Time:04-15

Having resource tree like this: picture File index.html sees the CSS, but file registration does not see it. Both located in one folder. Both have the same html definition:

<head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <title>All people</title>
    <link href="../../static/css/StyleCSS.css" th:href="@{css/StyleCSS.css}" rel="stylesheet" type="text/css" media="all" />
</head>
Files on github

What's wrong with it?

CodePudding user response:

I know it is weird, but if you change

th:href="@{css/StyleCSS.css}"

to:

th:href="@{/css/StyleCSS.css}"

it is gonna work. Though I have no idea why it behaves differently on index.

  • Related