css - Show checkbox as if unchecked when printing?
问题描述
I have a website with a list of checkboxes that can be used for printing as well. Though when printing it should print a clean slate, not the current state of the checkboxes on the website. However, I don't want to clear the state on the page itself, only on the printed version.
So is it possible to visually remove the tick from checkboxes in CSS?
Something like:
@media print
{
input[type=checkbox]
{
tick: none;
}
}
解决方案
我建议以下方法。
在打印中,您只需要可以手动勾选的边框,对吗?
因此,在打印 CSS 中,您可能只是更改复选框的设计,以便隐藏原始复选框 html ,无论是否选中都无关紧要。然后只需使用一些伪选择器设置样式或显示方形边框框,例如:之前:之后,,对于用于打印的复选框来说已经足够好了。
与通过 CSS 一样,您可以更改设计而不是表单的 html 状态。因此,在打印或打印样式表的媒体查询中,唯一的选择是设计、样式...
推荐阅读
- c# - 加载非托管 dll 而不将其写入磁盘
- excel - Application.ThousandsSeparator 仅影响单元格、图表标签、轴不起作用
- python-3.x - 错误:---只能将str(不是“字节”)连接到str
- android - 我使用其他依赖项的 Android 库在构建时无法解析
- javascript - 禁用javascript时的noscript图像
- rights - 如何在不删除其他组或用户名的情况下列出所有“共享文件夹”并将“经过身份验证的用户”添加到“共享权限”中?
- java - 我可以使用 if else 语句编写 Firestore 查询吗?
- powershell - 无法使用 powershell rest API 从 cosmos 获取文档数
- r - 如何在 R 中将数据表示为字符串,就像在 REPL 中一样?
- angular - 缩小屏幕时,卡片不改变行数