I am using an Omega sub theme on this site: http://95.138.187.151

I am using the style sheets at default breakpoints to get the layout working nicely for different devices, but when I shrink the browser to emulate smartphone size some of my mobile rules aren't working. Specifically, you can see the title on the carousel drop down beneath it and the controls dissapear.

I have all the mobile stuff set in global.css in these two media queries and it's working just as I would want it to on mobile devices.

@media only screen
and (min-device-width : 320px)
and (max-device-width : 568px)
and (orientation : portrait)

and

@media only screen
and (min-device-width : 320px)
and (max-device-width : 568px)
and (orientation : landscape)

I tried adding some styles in a media query like this in the hope that not specifying portrait and/or landscape might have it not be picked up on mobile, but alas it overrides what's in the query above:

@media only screen
and (min-width:320px)
and (max-width:568px)

I also tried changing the breakpoints in [theme].info to stop the mobile styles kicking in at a greater width on desktop, but to no avail.

To be honest I'd be happy if the styles in [theme]-alpha-narrow just remained on the desktop site no matter how small you shrink the browser and have the top two media queries above only kick in on mobile. Can anyone see where I'm going wrong? I'd prefer the site to not look such a mess if users on bigger monitors decide to shrink the site down etc...

Basically I just wanted to know if there was a media query I could use that would only affect desktop devices...?

Thanks in advance!

Rob.

Comments

Kendall Totten’s picture

Status: Active » Needs review

Max-width is the width of the target display area, e.g. the browser. Max-device-width is the width of the device's entire rendering area, i.e. the actual device screen
So you would not be able to test the device width by shrinking your browser window. Only by using an emulator or testing on an actual mobile device.

Not recommending this, but one reason you may choose max-device-width over max-width is if you were certain you did *not* want your desktop users to be able to see the responsive design in action when they scaled their window. Personally I am happy when sites adapt to the browser size because then I can have one browser window take up 50% of my screen and another window on the other half, and I can still see all the site content.

steinmb’s picture

Status: Needs review » Fixed

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.