Search
 
SCRIPT & CODE EXAMPLE
 

PYTHON

how to add css in flask app

<link rel= "stylesheet" type= "text/css" href= "{{ url_for('static',filename='styles/mainpage.css') }}">
Comment

flask link stylesheet

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

how to add a stylesheet to flask app

<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.
Comment

linking custom CSS in flask

{% block styles %}
{{super()}}
<link rel="stylesheet"
      href="{{url_for('.static', filename='mystyle.css')}}">
{% endblock %}
Comment

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
Comment

PREVIOUS NEXT
Code Example
Python :: how to make minecraft using python 
Python :: python debugger 
Python :: df reset index 
Python :: how to use inverse trigonometric functions in python 
Python :: what should you call a decimal value in python 
Python :: python run all tests 
Python :: python regex match words 
Python :: replace all missing value with mean pandas 
Python :: pyspark groupby multiple columns 
Python :: adf test python 
Python :: change colorbar size and place python 
Python :: removexa0 python 
Python :: random picker in python 
Python :: sklearn cross_val_score scoring metric 
Python :: assign python 
Python :: integer colomn to datetime pandas 
Python :: python resize image in tkinter 
Python :: Python Removing Directory or File 
Python :: instabot python 
Python :: what value do we get from NULL database python 
Python :: django createmany 
Python :: python wait for x seconds 
Python :: python array to string 
Python :: how to get a number from a string in python 
Python :: # invert a dictionary 
Python :: python console width 
Python :: how to save the model in python 
Python :: how to store in parquet format using pandas 
Python :: create list of numbers 
Python :: sort list alphabetically python 
ADD CONTENT
Topic
Content
Source link
Name
3+8 =