gpt4 book ai didi

html - 仅使用次要 print.css 打印网页格式

转载 作者:行者123 更新时间:2023-11-28 14:19:50 26 4
gpt4 key购买 nike

您是否曾觉得自己制作网络资料的时间太长了,以至于您开始忘记多年前学到的东西?

我试图记住您放在 print.css 顶部的某种声明,该声明采用页面的正常格式 .css 进行打印。 (当然,应用我在 printcss 中添加的少数 display:none)

我只是不记得要搜索什么。帮助?

和display:block有关系吗?

最佳答案

使用

<link rel="stylesheet" type="text/css" media="print" href="print.css">

这是打印样式表的示例

body { background: #fff; width: 80%; margin: auto; padding: 5%; }
h1, h2, h3, h4, h5, h6, p { color: #333; }
p { font-size: 14px; line-height: 21px; }
a { color: #243D8D; }
.post img { display: block; float: left; margin: 15px 15px 15px 0; }

您的主要目标是提高可读性。因此,以实现这一目标的方式编写您的 CSS。

关于html - 仅使用次要 print.css 打印网页格式,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/8650429/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com