所以我正在制作一个带有 html 和 css 的文档用于打印,当我尝试选择整个文档的特定页面时:
@page :nth(5) {
background-color: aqua;
}
它不选择页面(在这个例子中是背景颜色)
我想实现的是选择整个文档的特定页面。
最佳答案
请引用documentation (或对于规范,here)。关于 @page
规则的使用:
You can only change the margins, orphans, widows, and page breaks of the document. Attempts to change any other CSS properties will be ignored.
如您所见,更改 background-color
属性将被忽略。
关于html - 选择@page的特定页面,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/45980294/