【问题标题】:input height different in iosios中的输入高度不同
【发布时间】:2015-08-25 17:14:44
【问题描述】:

我在右侧有一个搜索栏和一个按钮,在一个名为 homesearchcontent 的 div 内。问题是在 IOS 触摸设备上,搜索栏比按钮高。

代码如下:

HTML:

<form action='./results.php' method='post' class="homesearchcontent">
    <input type='text' name='input' id="searchdevice" class="search-field"  placeholder="" /> 
    <input type='image' src='img/search6.png' class="search-button">
</form>

CSS:

.homesearchcontent { 
    position: relative;
    padding-left: 2px;
    width: 100%;
    text-align: center;
    margin-left: auto;
    margin-right: auto;
    padding-bottom: 50px;
}
.search-field {
    -webkit-border-radius: 3;
    -moz-border-radius: 3;
    border-radius: 3px;
    border: solid #191919 1px;
    padding-right: 1%;
    padding-left: 1%;
    width: 70%;
    height: 40px;
    vertical-align: top;
    font-size: 1.8em;
    font-family: Arial, sans-serif;
    text-decoration: none; 
}
.search-button {
    outline: none;
    vertical-align: top;
    width: 36px;
    height: 36px;
    clear: both;
    -webkit-border-radius: 3px;
    -moz-border-radius: 3px;
    border-radius: 3px;
    background: #ffffff;
    padding: 2px 7px 2px 7px;
    border: solid #191919 1px;
    text-decoration: none;
}

谁能帮帮我?

【问题讨论】:

  • 问题存在于所有移动设备上还是仅在iOS上?
  • 仅在 IOS TOUCH 设备上。在 Mac 和其他非 IOS 触控设备上它可以工作。
  • 你没有关闭第二个输入,我认为这是问题 你需要关闭它 />
  • 感谢您注意这一点。不幸的是,它并没有解决问题。

标签: html ios css height


【解决方案1】:

尝试对两个输入使用box-sizing: border-box; 和相同的高度。

【讨论】:

  • 你先生是男人的上帝:P
猜你喜欢
  • 1970-01-01
  • 2012-11-19
  • 2015-03-05
  • 2021-03-24
  • 1970-01-01
  • 2021-09-22
  • 1970-01-01
  • 1970-01-01
  • 2012-10-28
相关资源
最近更新 更多