Python模块比萨:如何更改背景颜色为所有页? [英] Python module Pisa: how change background color for all page?

查看:128
本文介绍了Python模块比萨:如何更改背景颜色为所有页?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我怎样才能改变所有网页的背景颜色?

How i can change background color of all page?

是这样的:

体,DIV {背景颜色:#f4f4f4; }

现在只背景与信息格变化,其余页有白色。如果可能的话,你可以写例子?

Now background changes only for div with information, remaining page have white color. if it is possible, can you write example?

P.S。怎样绘制边框?

P.s. How i can draw border around ?

推荐答案

Acording到documentacion <一个href=\"https://github.com/chrisglass/xhtml2pdf/blob/master/doc/usage.rst#supported-page-properties-and-values\" rel=\"nofollow\">https://github.com/chrisglass/xhtml2pdf/blob/master/doc/usage.rst#supported-page-properties-and-values @page只接受一些CSS propierties:

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:

背景图片
尺寸
保证金,保证金底,利润率左,保证金右,的margin-top

background-image size margin, margin-bottom, margin-left, margin-right, margin-top

所以,也许easyest是让JPG绘制背景颜色和边框的背景。并使用图像背景图像propierty:

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')}

这篇关于Python模块比萨:如何更改背景颜色为所有页?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆