Page-break-inside:避免不工作 [英] Page-break-inside:avoid not working

查看:101
本文介绍了Page-break-inside:避免不工作的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我的 (Wordpress) 网站有一个打印样式表,我希望图像打印在单个页面上,而不是跨页面拆分.在某些情况下,甚至文本行也被跨页面拆分.我在我的打印样式表中包含了 img {page-break: avoid;) ,但没有运气.我找到了一些以前的答案,但它们有点旧.

I have a print stylesheet for my (Wordpress) site, and I want images to print on a single page rather than being split across pages. In some cases, even lines of text are being split across pages. I've included img {page-break: avoid;) in my print stylesheet, but no luck. I've found some previous answers but they're kind of old.

是否有一种可靠的方法可以在单个页面上打印中等大小的图像而不是将其拆分到多个页面上?为什么文本行会跨页?

Is there a reliable way to print a moderately-sized image on a single page rather than splitting it across pages? Why are lines of text breaking across pages?

网站:http://74.220.217.211/housing-developments/grafton-townhomes/

相关帖子:

什么是最有用的媒体=打印"特定的、跨浏览器兼容的 css 属性?

使用 CSS 避免分页的正确方法是什么?

推荐答案

可能是img元素的父元素有样式:

It could be that the parent element of the img element has style:

display: flex

然后闯入无效.

例如,如果您将父元素的显示样式更改为:

For example if you change parent element display style to:

display: block

然后就可以了.

这篇关于Page-break-inside:避免不工作的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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