skip to Main Content

HTML code:

HTML code

I have tried everything to link style.css to products.ftlh ( ftlh is apace freemarker )
I can’t solve this problem. I need help. I notice this error in the developer page:

Refused to apply style from 'http://localhost:8080/login' because its MIME type ('text/html') is not a supported stylesheet MIME type, and strict MIME checking is enabled.

I’ve tried to change the link tag.

2

Answers


  1. Shouldn’t you specify the path to the file starting from the resources folder? "static/css/style.css"

    Login or Signup to reply.
  2. try setting the Link as a th:href like this:

    <link
      rel="stylesheet"
      type="text/css"
      th:href="@{/css/style.css}"
    />
    

    th:href looks in the static folder by default so just specify the css folder

    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search