Tom. I'm not sure if you know about css3 media queries, this is a way of nesting different sizes and screen resolutions.
You can find the specification at http://www.w3.org/TR/css3-mediaqueries/
With media css3 requests, the browser will load stylesheets that match the specified request in the media attribute of the link tag.
Below are some examples that may help.
how can you detect its rotation?
For instance:
<link rel="stylesheet" media="all and (max-device-width: 480px)" href="iphone.css"> <link rel="stylesheet" media="all and (min-device-width: 481px) and (max-device-width: 1024px) and (orientation:portrait)" href="ipad-portrait.css"> <link rel="stylesheet" media="all and (min-device-width: 481px) and (max-device-width: 1024px) and (orientation:landscape)" href="ipad-landscape.css">
The above layout control method is much faster than javascript manipulation.
More specifically
Does it reload content?
No, it does not reload the content, it displays the same page, therefore, if in your layout, for example, the width of the container is width = 100%, the browser will adapt to this.
source share