How to style HTML in flask


So I want to style a HTML page on flask but apparently it odesn’t seem to work
Repl link:


<!DOCTYPE html>
<html lang="en">
  <meta charset="UTF-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <link href="static/css/style.css" type="text/stylesheet" rel="stylesheet">
  <h1 id="title">Username + Password Flask Authentication</h1>
  <button onclick="window.location.href='/register';">
  <button onclick="window.location.href='/login';">
      Log In

Could you please send a link to the Repl?

Try changing the href to ../static/css/style.css.

So <link href="../static/css/style.css" type="text/stylesheet" rel="stylesheet">?

Still not working :frowning:


<link href="./static/css/style.css" type="text/stylesheet" rel="stylesheet">

It’s still now working :sob:

try to change from:

<link href="../static/css/style.css" type="text/stylesheet" rel="stylesheet">


<link href="{{ url_for('static', filename='css/style.css') }}" rel="stylesheet">

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.