Detecting Media Question Help in CSS and JavaScript

No Comments

You’ll be able to’t simply do @media (prefers-reduced-data: no-preference) alone as a result of, as Kilian Valkhof says:

[…] that will be false if both there was no assist (for the reason that browser wouldn’t perceive the media question) or if it was supported however the consumer needed to protect knowledge.

Often @helps is the software for this in CSS, however that doesn’t work with @media queries. Seems there’s a answer although:

@media not all and (prefers-reduced-data), (prefers-reduced-data) {
/* … */

It is a considerably advanced logic puzzle involving media question syntax and the way browsers consider these items. It’s good you’ll be able to in the end deal with a no-support fallback scenario in a single expression.

Direct Hyperlink to ArticlePermalink

The submit Detecting Media Question Help in CSS and JavaScript appeared first on CSS-Tips. You’ll be able to assist CSS-Tips by being an MVP Supporter.

    About Marketing Solution Australia

    We are a digital marketing company with a focus on helping our customers achieve great results across several key areas.

    Request a free quote

    We offer professional SEO services that help websites increase their organic search score drastically in order to compete for the highest rankings even when it comes to highly competitive keywords.

    Subscribe to our newsletter!

    More from our blog

    See all posts

    Leave a Comment