我有一个 CSS 文档,其中包含部分“正常”的 CSS 以及在调整窗口大小时对 CSS 所做的一些更改:
@media only screen and (min-width: 400px) and (max-width: 767px) {
/* css */
}
现在,当我打印我的 HTML 页面时,它只使用“普通”css。
但是,在打印页面时,我想使用“普通”CSS 加上来自此媒体查询的部分。
有办法吗?
最佳答案
只需在 @media
规则中添加一个逗号后跟 print
,如下所示:
@media only screen and (min-width: 400px) and (max-width: 767px), print {
/* css */
}
关于html - 将媒体查询样式应用于媒体打印?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/23753348/