Forum How do I...?

orientation media query

wouterg
Hello,

I've read in the release notes of princeXML 11 that it now supports "CSS4 Media Queries", I am trying to use an orientation media query but it fails. I've tried to put it in the css file as well as creating to different stylesheets and defining the media query on the link to the stylesheet but it doesn't seem to work, it always takes the styles from the portrait one.


<style>
/* page size */
@page {
size: US-Letter landscape;
margin: 0;
padding: 0;
}
</style>
<link rel="stylesheet" media="all and (orientation:portrait)" href="portrait.css">
<link rel="stylesheet" media="all and (orientation:landscape)" href="landscape.css">
mikeday
Media queries can only detect the page size set by the --page-size command-line option, as allowing the style sheets to determine the page size would allow infinite loops.
wouterg
would my example work if I use the command line instead of the GUI?
mikeday
Only if the page size is specified on the command-line; the media queries are evaluated before any @page rules in the style sheets are processed.
wouterg
ok thanks for the info I'll give it a try