I've got some styles specifically for print, which are being applied correctly with a print media query. The thing is, my layout breaks a bit if you switch to landscape printing, and I'd like to tweak some things for it. Is there any way to define styles for landscape printing?
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试):
问题:
回答1:
Media Queries offer matching against the device's orientation:
@media print and (orientation: landscape) {
/* landscape styles */
}
@media print and (orientation: portrait) {
/* portrait styles */
}