jquery simplemodal:将#simplemodal-container移动到0,0进行打印?

发布于 2024-08-13 08:23:32 字数 245 浏览 2 评论 0原文

我们的 simplemodal 警报 div 需要可打印。在大多数情况下,内容本身应该很好地适合页面,但我无法覆盖打印 CSS 中的定位以使其与顶部/左侧齐平以便打印,以避免右侧被切断。

似乎我可以在打印 CSS 中更改 #simplemodal-container 来更改除定位之外的所有内容。我尝试将其绝对定位并关闭所有填充和边距,但没有任何效果:它仍然像在屏幕版本上一样出现在中心。

有谁知道如何覆盖 media="print" 的方法?

Our simplemodal alert div needs to be printable. The content itself should fit on the page fine in most cases, but I can't override the positioning in my print css to get it flush top/left for printing to avoid having the right side cut off.

It seems like I can change #simplemodal-container in my print css for everything but positioning. I've tried to position it absolutely and turn off all padding and margins but nothing works: it still appears in the center as it does on the screen version.

Does anyone know a way to override this for media="print"?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

只有影子陪我不离不弃 2024-08-20 08:23:32

我假设覆盖不起作用,因为 #simplemodal-container 应用了内联样式。您可以尝试以下解决方案(不幸的是,该解决方案不适用于 IE <= 6):

#simplemodal-container[style] {
    position: absolute !important;
    top: 0 !important;
    left: 0 !important;
}

I'm assuming the overrides weren't working because #simplemodal-container has inline styles applied. You could try the following solution (which unfortunately won't work on IE <= 6):

#simplemodal-container[style] {
    position: absolute !important;
    top: 0 !important;
    left: 0 !important;
}
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文