Я не могу использовать свойство CSS фонового цвета в шаблоне Python, используя пакет драматурга, во-первых, я попробовал применить встроенный CSS style="background-color:red", во-вторых, использовал тег сценария, используя js, все еще не работает, и, наконец, я установить содержимое html, когда PDF-файл создается в пакете драматурга в шаблоне Python, но цвет фона все еще не применяется
with sync_playwright() as p:
browser = p.chromium.launch()
page = browser.new_page()
page.set_content(html_content, wait_until="networkidle")
html_content = '
footer_template = """
.footer {
font-size: 10px;
text-align: center;
width: 100%;
margin: 10px 1cm 0 1cm;
font-family: "Times New Roman", sans-serif;
background-color:red;
}
.footer-content {
display: flex;
align-items: center;
justify-content: space-between;
width: 100%;
height: 100%;
}
.fw-bold {
font-weight: bold;
}
Powered By TECHstile.in
This is a Computer Generated Invoice
{{invoice_number}}-
/
"""
template = Template(footer_template)
Подробнее здесь: https://stackoverflow.com/questions/787 ... playwright
Не могу использовать CSS-цвет фона в драматурге ⇐ CSS
-
- Похожие темы
- Ответы
- Просмотры
- Последнее сообщение