Reputation: 43
I want to use CSS style to detect the page orientation in printing and then apply different styles when user choose different orientations (landscape or portrait).
@media print{ /*portrait*/ /*landscape*/}
Is there any way to do that?
Thanks
Upvotes: 3
Views: 4160
Reputation: 796
Use the orientation: ...
media selector. Here's an example:
@media print and (orientation: portrait) {
/* Your code for portrait orientation */
}
@media print and (orientation: landscape) {
/* Your code for landscape orientation */
}
Upvotes: 9