On Sep 20, 2010, at 10:17 AM, tee wrote:
> Something to add, the other day I was trying to serve a different
> background-size for iPad portrait view, using the min-width throws the fixed
> layout into fluid layout for desktop version.
>
> Example:
> /* desktop version */
> #container: width :980px
>
> @media all and (min-device-width: 780px) and (orientation:portrait)
> {
>
> #container{width:98%; background-position: left 165px;
> -webkit-background-size:100% auto;
> -moz-background-size:100% auto;
> -o-background-size:100% auto;}
> }
>
> The " (orientation:portrait)" part doesn't matter. I don't quite understand
> why the "min-width" and "min-device-width" could affect the container width
> for desktop version.
>
>
> Once I changed it to this the 980px stay.
> @media only screen and (orientation: portrait) and (device-width: 768px)
I assume you did this test on your desktop by reducing the width (only) of the
window
@media all and (min-device-width: 780px) and (orientation:portrait) {}
says
1. the device is at least 780px wide (that almost certainly applies to your
desktop monitor)
2. the orientation (of the window) is 'portrait' (the window is taller than it
is wide)
both conditions must be true
What I guess you did:
- starting with a window that is wider than tall ( = landscape)
- reduce window width - the window becomes taller than it is wide.
Now try reducing the _height_ of the window and see what happens…
Here is a little test for you to play (works at least with Gecko 1.9.2 and
Safari 5):
http://dev.l-c-n.com/_temp/mq17.html
Philippe
---
Philippe Wittenbergh
http://l-c-n.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/