Is it possible to put CSS @media rules inline?

@media at-rules and media queries cannot exist in inline style attributes as they can only contain property: value declarations. As the spec puts it: The value of the style attribute must match the syntax of the contents of a CSS declaration block The only way to apply styles to one specific element only in certain … Read more

iPhone 6 and 6 Plus Media Queries

iPhone 6 Landscape@media only screen and (min-device-width : 375px) // or 213.4375em or 3in or 9cm and (max-device-width : 667px) // or 41.6875em and (width : 667px) // or 41.6875em and (height : 375px) // or 23.4375em and (orientation : landscape) and (color : 8) and (device-aspect-ratio : 375/667) and (aspect-ratio : 667/375) and (device-pixel-ratio … Read more

CSS media queries: max-width OR max-height

Use a comma to specify two (or more) different rules: From https://developer.mozilla.org/en-US/docs/Web/CSS/Media_Queries/Using_media_queries Commas are used to combine multiple media queries into a single rule. Each query in a comma-separated list is treated separately from the others. Thus, if any of the queries in a list is true, the entire media statement returns true. In other … Read more

@Media min-width & max-width

I’ve found the best method is to write your default CSS for the older browsers, as older browsers (including IE 5.5, 6, 7 and 8) can’t read @media. When I use @media, I use it like this: But you can do whatever you like with your @media. This is just an example of what I’ve found best for … Read more