We live in a world where our websites are more likely to be displayed on the small touchscreens of mobile devices than on the large monitors of desktop computers. It is up to us to ensure that all web pages and web applications will render correctly on all devices, and this is where Cascading Style Sheets come in to save the day.
CSS media queries are not new by any means, but members of the core development team of this powerful programming language have some major improvements in mind for upcoming releases. Let's take a look at the future of CSS media queries and how they will shape responsive design.
We want all of our site elements to look good on our mobile devices, so we'll need to make sure that they display properly. While media queries are just JavaScript functions that use HTML to create web pages on devices that run different versions of browsers, they can be particularly useful when using multiple devices.
The media query can be used to style the HTML to suit a different device, and it is an alternative to the document.write() event that we previously covered. For mobile devices (using the browser or some other development platform) it may be beneficial to use the media query with an element whose media query value matches the value of the media query value on the page in question. For example, imagine that you're editing a blog post that we published on a device running iOS 5 or later, but you can't use this CSS style for your blog post on other devices. We can also use media queries like this to style an element that is referenced and displayed on different browsers and devices.
When using media queries, you'll want to write the style for the same size device that you're reading your HTML from. The size of the media query is a combination of all of the media query parameters, with special handling for the width, height, and margins. This can help you keep your parameters between about 1-2 points of device-to-device variation for the best view of content. For more information click here https://blog.rajatkapoor.me/css-container-queries-the-future-of-responsive-web-design-is-almost-here.