You can't use Jinja directly in the CSS file since you normally don't render it as a template, but there is 3 alternate way to achieve your need:
Method 1
Use correct relative path in your CSS file:
background: url("/static/images/bg.jpg") no-repeat 0px 0px;
Method 2
Put your background line into the template:
background: url("{{ url_for('static',filename='images/bg.jpg') }}") no-repeat 0px 0px;
Method 3
Define a CSS variable in your template:
:root {
--background-url: {{ url_for('static', filename='images/bg.jpg') }}
}
Then use it in your CSS file:
background: url("var(--background-url)") no-repeat 0px 0px;