Ich versuche, einen Bildhintergrund mit wx.html2 zu setzen Ich habe alle css/html Tags ausprobiert, aber die Bilder gehen nicht rein. Ich schätze, ich benutze es ist falsch. Ich habe ein HTML-Dokument erstellt und getestet. Es wird normalerweise im Browser funktionieren. Was ist das Problem? In html2 scheint das bildbezogene CSS nicht alles zu sein.Wx.html2 Hintergrundbild ist nicht eingefügt
Zum Beispiel, bildbezogene Dinge wie Gradienten.
#-*- coding: utf-8 -*-
import wx.html2
HTML_CODE= """
<!DOCTYPE HTML>
<html lang="ko">
<head>
<meta charset="utf-8">
<title>HTML TEST</title>
<style type="text/css">
body{{
background-image: url(1.png);
}}
table{{
width: 100%;
border-collapse: collapse
}}
table, caption, th, td{{
border: 1px solid black;
text-align: center;
color:black;
height: 100px;
font-size: 20px;
}}
</style>
</head>
<body scroll='no'>
<table>
<caption>Hello world</caption>
<thead>
<tr>
<th>Ipsum</th>
<th>Ipsum</th>
<th>Ipsum</th>
<th>Ipsum</th>
<th>Ipsum</th>
<th>Ipsum</th>
</tr>
</thead>
<tbody>
<tr>
<td>{0}</td>
<td>{1}</td>
<td>{2}</td>
<td><p style='color:{3}'>{4}</p></td>
<td><p style='color:{5}'>{6}</p></td>
<td><p style='color:{7}'>{8}</p></td>
</tr>
<tr>
<td>{9}</td>
<td>{10}</td>
<td>{11}</td>
<td><p style='color:{12}'>{13}</p></td>
<td><p style='color:{14}'>{15}</p></td>
<td><p style='color:{16}'>{17}</p></td>
</tr>
</tbody>
<tfoot>
<tr>
<td colspan="6">Table Foot</td>
</tr>
</tfoot>
</table>
</body>
</html>
"""
app = wx.App()
frame=wx.Frame(None,-1)
browser = wx.html2.WebView.New(frame, size=(460, 400))
browser.SetPage(HTML_CODE,"")
frame.Show(True)
app.MainLoop()