how to add css in flask app
<link rel= "stylesheet" type= "text/css" href= "{{ url_for('static',filename='styles/mainpage.css') }}">
how to add css in flask app
<link rel= "stylesheet" type= "text/css" href= "{{ url_for('static',filename='styles/mainpage.css') }}">
how to link css to html flask
#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
Copyright © 2021 Codeinu
Forgot your account's password or having trouble logging into your Account? Don't worry, we'll help you to get back your account. Enter your email address and we'll send you a recovery link to reset your password. If you are experiencing problems resetting your password contact us