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
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
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 */
}