打印CSS:适合一页 [英] print css: fit in one page

查看:44
本文介绍了打印CSS:适合一页的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在我的页面中只有一张图像.1500x3000像素的种类.
在打印机中,我需要将此图像的最大宽度设置为页面的宽度,因此我这样做了:在CSS中将宽度设置为100%,并且它可以正常工作.
但是身高...身高100%的旧胡说永远不会起作用.因为它始终是父容器的100%,所以必须定义一个高度.或html或body.
因此,我的问题是:使此图像适合一页.
有什么想法吗?

In my page there's only one image. Kind of 1500x3000 px.
In the printer, I need that this image's maximum width to be the width of the page, so I did: width 100% in the css, and it works.
But the height... the old bullshit of height 100% will never work. Because it always will be 100% of the parent container, then someone must have height defined. Or html or body.
So, my question is: make this image fit in one page.
Any ideas?

推荐答案

对不起,将解决方案"作为注释:

Ok sorry for putting the "solution" as a comment:

我最后要做的是假设99%的客户端(是对的)使用的是单个页面大小.因此,我在打印界面上发出了一些警告,该警告仅适用于页面大小"X".太糟糕了.但目前为止效果很好

What I've ended up doing was assume that 99% of the clients (that's true) they use a single page size. So I put some warning in the print interface that will only work with the page size "X". too bad. but it's working out so far

这篇关于打印CSS:适合一页的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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