CSS won't load?
Hello,
The problem is that I have a project that includes Java, Spring Boot, ReactJS, CSS, JS, and RestAPI. My only problem is that when I load the page: localhost:8080/login.html, the HTML displays the contents of the HTML file but doesn't include the CSS file at all. The paths to the individual files are also correct, as they are linked, but styling via CSS doesn't work.
login.html: https://codefile.io/f/uD0jP33Wef style.css: https://codefile.io/f/AGN6ENmt6t script.js: https://codefile.io/f/unKOx5NUi6
It would be really great if someone could help me with this.
Try using cache empty or private mode.
Alex
Did I, both did not work :/
I also tried it with a simple CSS code, but nothing is taken over from any reason.
As soon as I enter localhost:8080/static/style.css I also get to the Whitelable error page. Do I also have to implement it in LoginController.java? But actually it would have to accept login.html… I don’t understand. It is definitely correctly linked as it opens at strng + click the file.
What does the errorlog say?
Thank you, didn’t even know that it was…
Then take this binding
Now I come up with localhost:8080/style.css but as soon as I connect it with login.html the complete page is white.
It might be that if you want to include the css datei with the following command:
The slash at the beginning of the path indicates that it is searched from the root directory.
I just tried it, and I didn’t get it
No, it has nothing to do with it.
So it’s got something to do with the ReactJS zeug or the jumping boat, so I haven’t dealt a lot yet mainly with html,css and js
Then you must have done something wrong.
It is an absolute path. The page must be accessed via a domain and the Static-Ordner must be in the root directory.