Mobile orientation change not applying CSS
My problem is related to the order of my CSS requests.
I used to define 'min-device-width'
before the rest.
@media
only screen and (min-device-width: 240px) and (max-device-width: 520px),
only screen and (min-width: 240px) and (max-width: 520px) { ... }
But if I define it last, it works.
@media
only screen and (min-width: 240px) and (max-width: 520px),
only screen and (min-device-width: 240px) and (max-device-width: 520px) { ... }
For more information about device-width:- check out this question
Change CSS Based on Mobile Orientation
The below JQuery code seems to work best for me...the binding examples did not.
$(document).ready(function() {
$(window).resize(function() {
alert(window.orientation);
});
});
Related Topics
Responsive Bootstrap Designing in Cakephp 3X
Can't Style Text on Input Submit Button as Bold
Why Do 'Foo Bar' and 'Foo > Bar' Have the Same Specificity in CSS
CSS Grid - Repeatable Grid-Template-Areas
How to Simply Parse a CSS Like (!) File in My Qt Application
Textarea::Selection and ::-Moz-Selection
Rstudio 0.98.1028 Add Background Image Only to Title Slide
Chrome 10/Windows @Font-Face Encoding Trouble
How to Implement Read More/Read Less in Pure CSS
How to Modify the Strongloop's Loopback Explorer CSS
Show :After When Hovering Over the Parent Element via CSS
Span Background-Color & Padding Problems
Applying a Single Background Gradient to a Table Row
How to Place Div Inside Another Div to Absolute Position