Preserve HTML font-size when iPhone orientation changes from portrait to landscape

By , July 8th, 2013 , Tags: , , , 1 Comment

Question: I am developing a mobile website but have encountered this problem – a font size of 14px is displaying much larger in landscape than in portrait. However, it seems to be based on the fact that the Div size is set to 100% so in landscape it is obviously wider. What I don’t understand is why that should affect the size of the font given that 14px isn’t a relative size but a fixed one?

Is there an explanation for this that I am missing?


Answer: Apple rescales the font-size when the viewport changes to increase readability. It doesn’t matter that the font-size is set to something absolute like 14px. To disable it, you can use the following CSS:

The use of this property is described further in the Safari Web Content Guide.

  • rowilsonh


I founded CSS Matter in 2013 with the sole ambition of design, development, creativity and innovation on the Internet, which recognize and promote the best web designers, developers and web users in the world. I'm skilled, talented, creative and very passionate about my work. I like to work closely with people to ensure that each stage of a project goes great every step of the way. I like to ensure that all of my finished projects/work reflect how highly I would like to be perceived. I'm confident that with your ideas and my expertise we can create something that makes us both smile. If you like what I do, and think we could work together then don't hesitate to get in touch with me. Skype IM : cssmatter And Email

Want to write for CSS Matter?

If you're interested in becoming part of the CSS Matter team of authors, please send an email to Manish Salunke. It's best if you already have article ideas in mind – but if you don't, he'll help you find a good topic to cover.

Get Updates On Twitter

Do you want to get real-time updates, interesting web links, site news and announcements via Twitter? Follow CSS Matter on Twitter.

Subscribe to the RSS feed Today

The best way to keep up with CSS Matter articles regularly is by putting the CSS Matter RSS feed into your feed reader.