Question

I'm working on optimizing a website for mobile devices, and I'm nearly done (yay!) but one thing makes me rack my brain:

How it works

I used CSS to restyle a tab-bar (actually a list) to work like a dropdown-menu. When touching the only visible list element, jQuery toggles the class "open" on the ul-element and all list elements appear also. That's how it works.

The Problem

When unfolding the dropdown-menu, it's font-size increases from 15px to 19px. And in Inspector there is absolutely no hint why this happens. Adding a rule like font-size: 15px !important; has no effect.

I made a little screencast for you: http://youtu.be/MUTJfTK70PE?hd=1

Affected devices

  1. Android (Samsung Galaxy)
  2. iOS (iPod, iPhone, Simulator)

Windows Phone (Internet Explorer) is not affected (wow!)

I would be very thankful for every single idea!!

Was it helpful?

Solution 2

It turned out, that Mobile Webkits font resizing was the origin. This rule solved it:

-webkit-text-size-adjust: none;

OTHER TIPS

You may try adding something like this: font-size: 1.5rem;

In html5 this is best solved by explicitly setting the viewport in the page header. The statement

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

turns mobile font resizing off. Setting text-size-adjust to none has the disadvantage of disabling zoom on mobile devices, still requires heavy prefixing and the value none seems to be ignored by some browsers.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top