How to preserve HTML font size when iPhone orientation changes from portrait to landscape with CSS?

Spread the love

Sometimes, we want to preserve HTML font size when iPhone orientation changes from portrait to landscape with CSS.

In this article, we’ll look at how to preserve HTML font size when iPhone orientation changes from portrait to landscape with CSS.

How to preserve HTML font size when iPhone orientation changes from portrait to landscape with CSS?

To preserve HTML font size when iPhone orientation changes from portrait to landscape with CSS, we set the -webkit-text-size-adjust property.

For instance, we write

html {
  -webkit-text-size-adjust: 100%;
}

to use -webkit-text-size-adjust: 100%; to keep the font size in any orientation.

Conclusion

To preserve HTML font size when iPhone orientation changes from portrait to landscape with CSS, we set the -webkit-text-size-adjust property.

Leave a Reply

Your email address will not be published. Required fields are marked *