How to fix CSS3 media queries not working on mobile devices with HTML?

Spread the love

Sometimes, we want to fix CSS3 media queries not working on mobile devices with HTML.

In this article, we’ll look at how to fix CSS3 media queries not working on mobile devices with HTML.

How to fix CSS3 media queries not working on mobile devices with HTML?

To fix CSS3 media queries not working on mobile devices with HTML, we add a meta tag to make the browser detect the media queries.

For instance, we write

<meta content="width=device-width, initial-scale=1" name="viewport" />

to make the browser scale the content to the device’s width.

And then the media queries will be used to apply the styles for the given screen size.

Conclusion

To fix CSS3 media queries not working on mobile devices with HTML, we add a meta tag to make the browser detect the media queries.

Leave a Reply

Your email address will not be published.