Serving static files
This content is not available in your language yet.
As cool as the website currently is (not very), it would be nice to have some static files to serve. This could be images, CSS, JavaScript, or anything else that doesn’t change.
Adding static files
To add static files to your website, you need to create a folder called static
in the root of your project. Flask will automatically serve any files in this folder at the /static/
route.
Create a new folder called static
in the root of your project. Inside this folder, create a new file called style.css
with the following content:
Now, update the index.html
file to include this CSS file. Add the following line to the <head>
section of the file:
Your index.html
file should now look like this: