html - Height or Width Media Query Not Working -
I'm trying to set some media queries in my HTML but I have a problem. I would like to see the device's width and height and query to use the appropriate stylesheet. It looks at the height, but not the width, as much as I can tell. Here's my code:
& lt; Link rel = "stylesheet" media = 'screen and (minimum-width: 1500px), screen and (minimum height: 701px)' href = 'style.css "type =" text / css "/> gt; & lt; Link rel = "stylesheet" media = 'screen and (minimum-width: 1000px) and (max-width: 1499 px), screen and (minimum height: 501 px) and (max-height: 700px)' href = 'Tablet .css "type =" text / css "/> & Lt; Link rel = 'stylesheet' media = 'screen and (max-width: 99px), screen and (max-height: 500px)' href = 'mobile.css' type = 'text / css' />
With this code, you can have two stylesheets loaded at the same time. They can interfere with each other, and I think that this is not what you want. For example, width = 1200 px and height = 400 pixels tablet.css will be loaded (due to width) and mobile css (due to height) I think It is not what you want because when you build your CSS rules, these interactions must be kept in mind.
Nevertheless, most responsive web sites look at the width of the CSS to just set the proper rules.
For example, see how Bootstrap creates its responsive grid system:
Comments
Post a Comment