In a css file "url_for" will not work,and will give error as you get.
Can give relative path to image in css file.
If a make a "style.css" in my demo code with this in it.
Can give relative path to image in css file.
If a make a "style.css" in my demo code with this in it.
body { background-image: url('../images/back.jpg'); background-repeat-x: no-repeat; background-repeat-y: no-repeat; }In index.html i call "style.css" like this in head.
<head> <link rel=stylesheet type=text/css href="{{ url_for('static', filename='css/style.css') }}" /> </head>