Quantcast
Channel: Active questions tagged html - Stack Overflow
Viewing all articles
Browse latest Browse all 80254

HTML doesnt load CSS Styles, Spring Boot

$
0
0

I have in package template/index.html with link on static/css/style.css, i try to open with browser and dont see styles.

same code in simple directory with html+css it works. Why? What should I do to load css to templates?

If i put in template package - it works

<html lang="en" xmlns:th="http://www.thymeleaf.org">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0"/>
    <meta http-equiv="X-UA-Compatible" content="ie=edge"/>
    <link rel="stylesheet" type="text/css" th:href="@{../static/css/style.css}"/>
    <title>Main page</title>
</head>

Controller:

@Controller
@RequestMapping("/")
public class MainController {

    @GetMapping
    public String main(){
        return "main";
    }

}

CSS ERROR

enter image description here


Viewing all articles
Browse latest Browse all 80254

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>