问题
How i can change background color of all page?
like this :
body,div { background-color:#f4f4f4; }
Now background changes only for div with information, remaining page have white color. if it is possible, can you write example?
P.s. How i can draw border around ?
回答1:
Acording to the documentacion https://github.com/chrisglass/xhtml2pdf/blob/master/doc/usage.rst#supported-page-properties-and-values @page only accept few css propierties:
background-image size margin, margin-bottom, margin-left, margin-right, margin-top
So maybe the easyest is to make a jpg to draw the background with background color and border. And use that image in background-image propierty:
@page {background-image: url('local_path/to/your/image.jpg')}
回答2:
I hope this will help you
html,body{height:100%}
body,div { background-color:#f4f4f4; }
and your Second Question > How i can draw border around ?
add
border:1px #ccc solid
来源:https://stackoverflow.com/questions/19348998/python-module-pisa-how-change-background-color-for-all-page