Flask 9 – use css in the template

We can use a css file. To do this you add this code to the template.html file, we use as a base for all our pages.

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

This is the style.css

body {
    margin-left: 10%;
    margin-right: 10%;
    color: white;
    background-color: rgb(6, 14, 42);
}

 

Published by pythonprogramming

Started with basic on the spectrum, loved javascript in the 90ies and python in the 2000, now I am back with python, still making some javascript stuff when needed.