【问题标题】:HTML input tag type color, prevent automatic mobile zoom when activeHTML 输入标签类型颜色,活动时防止自动移动缩放
【发布时间】:2021-07-11 15:38:32
【问题描述】:

我想知道如何防止iOS和Android手机在选择“颜色”类型的输入标签时防止自动缩放。我在网上看到了一些解决方案,但没有一个适合我的用例。以下是我目前发现的内容以及我对它们的评论。

<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0,user-scalable=0"/> 这可以防止所有缩放,甚至是我手机上的手动缩放,这不是很好。

style="font-size:16px; 添加到输入标签。 这在我的手机上不起作用。

【问题讨论】:

    标签: html css input mobile colors


    【解决方案1】:

    input 获得焦点时,您似乎需要设置font-size 规则:

    input[type="color"]:focus {
      font-size: 16px;
    }
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2014-08-10
      • 2018-12-13
      • 2022-01-05
      相关资源
      最近更新 更多