在iOS中显示不同大小的输入字段 [英] Input field showing different size in iOS

查看:97
本文介绍了在iOS中显示不同大小的输入字段的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个背景和固定宽度/高度的输入字段。它在我的桌面上的所有浏览器中看起来都不错。但出于某种原因,它在 iPad iPhone 上看起来更大。

I have an input field with a background and a fixed width/height. It looks good in all the browsers on my desktop. But for some reason it looks bigger on the iPad and iPhone.

到目前为止。

width: 120px !important;
background-image:url('../img/header-input.png');
height: 30px;
-webkit-appearance: none !important;
-webkit-border-radius: 0;
border-radius:0;
@include border-radius(0);
outline: none;
border: none;


推荐答案

小心,据我了解Safari浏览器iOS在输入字段中添加了额外的填充。

Be careful, as far as I know Safari browser in iOS adds extra padding in the input fields.

尝试在css中使用此代码:

Try using this code inside your css:

padding: 0;

这篇关于在iOS中显示不同大小的输入字段的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆