输入高度不同 ios
input height different in ios
我在右侧有一个搜索栏和一个按钮,位于名为 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;
}
有人可以帮我吗?
尝试对两个输入使用 box-sizing: border-box;
和相同的高度。
我在右侧有一个搜索栏和一个按钮,位于名为 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;
}
有人可以帮我吗?
尝试对两个输入使用 box-sizing: border-box;
和相同的高度。