4 ms·
Is that what this is for? https://developer.mozilla.org/en-US/docs/Web/CSS/@media/aspect-ratio https://developer.mozilla.org/en-US/docs/Web/CSS/@media/aspe...
by jkochis 6y ago
Is that what this is for? https://developer.mozilla.org/en-US/docs/Web/CSS/@media/aspect-ratio https://developer.mozilla.org/en-US/docs/Web/CSS/@media/aspe...
- jefftk 6y agoYou can query for aspect ratio in CSS, yes. This can be useful for figuring out whether it's better to place something as, say, a sidebar vs a footer. The sites they are complaining about, however, are only looking at the horizontal dimension.
- Nathanael_M 6y agoI think primarily that's for constraining a div's aspect-ratio. Like making sure you have a div that's always 16:9 to hold a video player. I'd be interested in hearing other use cases, though.
- madeofpalk 6y agoNo, it's not.
- Nathanael_M 6y agoI'd be interested in hearing other use cases.
- madeofpalk 6y agoThe aspect ratio media query just lets you apply certain CSS to the page depending on the viewport aspect ration. It does not set an aspect ratio on an element. Maybe there’s something I’m missing, but I’m not sure how knowing the aspect ratio of the screen would help make an element 16:9. If my browser is narrower or wider, that doesn’t affect how I would style the element.
- Nathanael_M 6y agoOh, sorry, I was reading an article about the new CSS aspect-ratio property and mixed it up with the CSS aspect-ratio media query.