I am currently working on a single page application and I have the need to print the page with either landscape or portrait orientation based on the class of a specific div element. The challenge is that I want to achieve this using only CSS and without any JavaScript.
For instance, let's say I have a default size for printing
@media print {
@page {
size: landscape
}
}
However, my goal is to resize it if the block with the class "frame" has a modifier called "media"
Unfortunately, the following code does not work as intended:
@media print {
@page .frame ._media {
size: portrait
}
}