I utilized Bootstrap in my project, implementing the following code:
<div class="input-group">
<input type="text" class="form-control input-lg" autofocus>
<span class="input-group-btn">
<button class="btn btn-primary btn-lg" type="button">search</button>
</span>
</div>
While working with Bootstrap, I came across this snippet of code:
.input-group-btn:last-child > .btn {
margin-left: -1px;
}
Attempting to avoid the unnecessary margin-left:-1px;
, I wrote some CSS but encountered another issue:
Even when clicking outside the
<div class="input-group search-bar">
, the button still seems affected by margin-left:-1px;
This has left me puzzled – should I resort to writing JavaScript to resolve this problem?