简体   繁体   中英

How to use css stylesheet on jinja2 template?

<!DOCTYPE html>
<html>
  <head>
    <title>
    {%block title%}
    {%endblock%}
    </title>
    <link rel="stylesheet" type="text/css" href="{{ url_for('static', 
filename='css/main.css')}}">
  </head>
  <body>
    {%block body%}

    {%endblock%}
  </body>
</html>

I tried this but there is just no css styles that can be seen on my web page. It doesn't link to css file. I tried href="../static/css/style.css" and also tried replacing my href to src, but it still has the same result, no css style that can be seen.

css path is static/css/main.css

try ctrl+Shift+R to refresh the browser for chrome browser

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM