【发布时间】:2022-02-02 03:33:10
【问题描述】:
问题很简单,我使用的是 jinja2 html 模板,我应该包括 {{ url_for('static', filename='img/background.png') }} 在 url('') 内部,在 style="" 内部。
问题是引号冲突,因为有两个嵌套的'标记
<body id="body-pd" style="background: url('{{ url_for('static', filename='img/background.png') }}') no-repeat center center fixed; background-size: cover;">
是否可以使用某种转义字符?
【问题讨论】:
标签: python html flask jinja2 markup