设置打印 css 的好规则? [英] Good rules for setting up print css?

查看:34
本文介绍了设置打印 css 的好规则?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在寻找有关在打印网页时制作合适的打印 css 的任何建议/规则/指南.你有什么可以提供的吗?

I'm looking for any suggestion/rules/guides on making a decent print css for when a webpage is printed. Do you have any to offer?

推荐答案

以下是一些通用的打印样式,可用于获得更好的打印输出:

Here are some general print styles to use to get better print outs:

/* Print styles */
@media print 
{
    tr, td, th {page-break-inside:avoid}
    thead {display:table-header-group}
    .NoPrint {visibility:hidden; display:none}
    a {color:#000000}
}

顶部的防止在表格行内分页

The top one prevents page breaks inside of a table row

thead 样式使 thead 标记中的任何行对于表格跨越的每个页面都重复.

The thead style makes any rows in the thead tag repeat for each page that the table spans across.

NoPrint 是我用来在屏幕上显示某些内容的类,但不用于打印.

NoPrint is a class I use to show something on the screen, but not in print.

而且,我喜欢关闭链接颜色.

And, I like to turn off link colors.

这篇关于设置打印 css 的好规则?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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