打印样式表 - 打印页面宽度在Webkit与Gecko / IE中不同 [英] Print Stylesheet - Printed Page width Different in Webkit vs. Gecko/IE
问题描述
当在Safari / Chrome中打印以下页面时,内容(基本上是页面上的所有内容)被压缩到页面左侧,约为页面宽度的60%。
When printing the page below in Safari/Chrome, the content (everything on the page, basically) is squished into the left side of the page, at about 60% of the page's width.
但是,在FireFox和IE 7中,打印的页面显示内容为全宽(并且看起来不错,imo)。我将所有布局元素的大小调整为100%宽度(使用!很重要,以确保他们正在应用),Safari / Chrome仍然不会打印出全宽。
However, in FireFox and IE 7, the printed page shows the content as the full width (and looks quite nice, imo). I resized all the layout elements to 100% width (using !important to make sure they're applying), and Safari/Chrome still won't print out the full width.
这是我参考的页面:
http://archstl.org/commoffice/press-release/2010/local-catholic-principal-honored-fi
下面是一张图片Webkit(第一)和Gecko(第二)之间的区别:
And here's an image of the difference between Webkit (first) vs. Gecko (second):
推荐答案
我决定放弃尝试改进打印样式表,而只是接受不同浏览器中的奇数间距问题。
I've decided to give up on trying to improve the print stylesheets anymore, and instead just accept the odd spacing issues in different browsers.
我会建议任何人试图为您的网页打印样式,考虑使用@screen而不是@all作为您的主要网站样式表,这样可以使一些更复杂的布局更容易打印样式。
I would recommend, to anyone else trying to style your pages for print, to consider using @screen instead of @all for your main site stylesheets, though—this makes styling things for print easier on some more complex layouts.
无论如何,我们应该进入21世纪,忘记打印; - )
Anyways, we should just move into the 21st century and forget about printing ;-)
这篇关于打印样式表 - 打印页面宽度在Webkit与Gecko / IE中不同的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!