Solved

Question about the @media screen query

Posted on 2014-10-14
3
175 Views
Last Modified: 2014-10-15
When you specify an orientation - as in the sample query below - what is that supposed to accomplish? Does it not even allow the webpage to load unless the device is held in landscape fashion? Or will it display in landscape only, even if held in portrait fashion? I'm just not sure what specifying the orientation is supposed to accomplish . . . and figured it would be easier to "ask the experts" rather than doing a bunch of testing. (I'm kind of a novice html and css guy . . . and have been "out of the loop" for a while when it comes to writing code.) Thanks!

/* iPads (landscape) ----------- */
@media only screen
and (min-device-width : 768px)
and (max-device-width : 1024px)
and (orientation : landscape) {
/* Styles */
}
0
Comment
Question by:Thunderman54
3 Comments
 
LVL 58

Accepted Solution

by:
Gary earned 250 total points
ID: 40380983
The media query is for specifying additional css that should be applied when the device fits those specifications
0
 
LVL 53

Assisted Solution

by:COBOLdinosaur
COBOLdinosaur earned 250 total points
ID: 40382957
All the stylesheets are brought in at load without reference to the current device or UA so that they are available if needed.  If the user goes from portrait to landscape, then the media query causes the browser to switch to the specified styling which has already been loaded parsed and serialized in the Document object, provided that the browser, OS and device support the landscape qualifier; which may not always be the case.

Cd&
0
 

Author Closing Comment

by:Thunderman54
ID: 40383098
Thanks to both of you for your input. :)
0

Featured Post

Master Your Team's Linux and Cloud Stack

Come see why top tech companies like Mailchimp and Media Temple use Linux Academy to build their employee training programs.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Although it can be difficult to imagine, someday your child will have a career of his or her own. He or she will likely start a family, buy a home and start having their own children. So, while being a kid is still extremely important, it’s also …
When crafting your “Why Us” page, there are a plethora of pitfalls to avoid. Follow these five tips, and you’ll be well on your way to creating an effective page.
This tutorial will teach you the core code needed to finalize the addition of a watermark to your image. The viewer will use a small PHP class to learn and create a watermark.
The viewer will learn the benefit of using external CSS files and the relationship between class and ID selectors. Create your external css file by saving it as style.css then set up your style tags: (CODE) Reference the nav tag and set your prop…

790 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question