<link rel= "stylesheet" type= "text/css" href= "{{ url_for('static',filename='styles/mainpage.css') }}">
<link rel="stylesheet" type='text/css" href="{{ url_for('static', filename='main.css') }}">
Make sure that the css is in the 'static' file you should have created
inside the root directory of the project.
{% block styles %}
{{super()}}
<link rel="stylesheet"
href="{{url_for('.static', filename='mystyle.css')}}">
{% endblock %}
#link it in html
<link rel= "stylesheet" type= "text/css" href= "{{url_for('static', filename='styles/styles.css') }}">
#place a config for your app so that browser doesn't store cashe, if this doesn't update your css clear browser cash for last {x} hours
if __name__ == '__main__':
app.config['SEND_FILE_MAX_AGE_DEFAULT'] = 1
app.run()
#make sure that your directory looks something like this...
|root|
MainFileWithFlaskProgram.py
|static|
|styles|
styles.css
|templates|
YourHTMLFile.html
/app
- app_runner.py
/services
- app.py
/templates
- mainpage.html
/static
/styles
- mainpage.css