On 1/12/2013 8:12 AM, David Hucklesby wrote:
On 11/30/13, 11:55 AM, Bjoern Hoehrmann wrote:
* Gabriele Romanato wrote:
@media screen and (orientation: landscape ) { /* ... */ }
As far as I know, browsers - even desktop browsers - support the
DeviceOrientation event plus a series of APIs related to orientation.
The
point is that on my Mac I actually cannot rotate my screen!
I have one monitor that could be rotated and I had to change from
landscape to portrait in the OS settings. :-)
Further,
what
have JS APIs to do with CSS? Do they affect indirectly the way a browser
interprets certain rules (like in this case?).
Well, http://www.w3.org/TR/css3-mediaqueries/#orientation the feature
has the
value `landscape` if the `height` feature is smaller than the `width`
feature. It does not have anything to do with APIs or whether you can
rotate
your screen.
I'm not sure about that. I have never had access to a mobile device to
test but I do observe how the flow changes (from top left) depending on
how you hold the mobile device.
I think that's correct. If I change Codepen's results frame width, the text
changes from green to red as the frame moves through the point where the
frame
is a square. I imagine the _device_ orientation is only relevant for
devices
that display the browser at full screen.
No. This is depended on the height to width ratio of the viewport. Load
up the below demo and change the height and width of the viewport and
notice how the color changes from red to blue or visa verso.
<style type="text/css">
p {
color: green;
}
@media screen and (orientation: landscape) {
p {
color: red;
}
}
@media screen and (orientation: portrait) {
p {
color: blue;
}
}
</style>
<p>This should be red or blue on a monitor (screen) 'and' a mobile
browser.</p>
As for the "and" being a logical relation, I believe that is also
correct. The
color will be green for print, for example.
Correct.
FWIW I have a hard time understanding the W3 specifications too! Relying
more on
the Mozilla Developer Network these days. :)
--
Alan Gresley
http://css-3d.org/
http://css-class.com/
______________________________________________________________________
css-discuss [[email protected]]
http://www.css-discuss.org/mailman/listinfo/css-d
List wiki/FAQ -- http://css-discuss.incutio.com/
List policies -- http://css-discuss.org/policies.html
Supported by evolt.org -- http://www.evolt.org/help_support_evolt/