【发布时间】:2015-08-01 07:19:15
【问题描述】:
由于某些原因,当我在搜索框中输入值并按搜索图标时,它没有热输入。它只发生在FF中。在 chrome 中,如果你按下搜索图标,它就会起作用。
<div class="col-lg-12">
<input id="query" name="query" type="search" class="form-control input-lg" value="">
<button type="submit" class="submit"><i class="fa fa-search"></i></button>
</div>
样式:
button.submit {
border: 0px;
box-sizing: initial;
padding: 0px;
margin: 0px;
}
.fa-search {
position: absolute;
top: 8px;
right: 22px;
}
知道如何解决这个问题吗?我的意思是当图标搜索被按下时按钮不应该是可点击的吗?
【问题讨论】:
-
请加一些代码让我们好好看看
-
@Hello Universe 在 Firefox 搜索中
button落后于input框,因此您必须提供position到button标记,然后还提供z-index。或者,如果您无法使用css获得解决方案,请尝试在click的submit按钮上使用event.stopPropagation。 -
与此问题相关的任何内容stackoverflow.com/questions/18741019/…
标签: html css font-awesome-4