【发布时间】:2018-01-26 20:28:53
【问题描述】:
我这辈子都想不通。为什么按钮顶部有一个额外的像素?另外为什么它的左边有额外的空白?我要做的就是让输入和彼此相邻的按钮看起来相连。
这可能吗?
html{
background: green;
}
form {
height: 40px;
input {
height: 30px;
width: 75%;
max-width: 400px;
padding: 5px 10px;
font-size: 16px;
border: 0;
background: gray;
}
button {
background: #6699FF;
height: 40px;
width: 60px;
background-image: url('https://i.imgur.com/Tp7TTNO.png');
background-repeat: no-repeat;
background-position: center center;
background-size: contain;
background-origin: content-box;
padding: 7px;
border: 0;
color: transparent;
}
}
<form>
<input type="text" name="Term" class="saearch-input" placeholder="Search more than 3800 summaries">
<button type="submit" class="">Search</button>
</form>
如果您也无法解释,但知道我如何以另一种方式实现这一目标,我也会接受它作为答案。
【问题讨论】:
-
上面的链接不处理输入标签,但这是同一个问题,修复都可以在这里工作