Hooman Bahreini
Hooman Bahreini

Reputation: 15569

input-group border doubling up in the middle

I am using bootstrap 4 input-group as shown below. I have changed the border-width to 10px. It seems like the border width in the middle is doubling up:

enter image description here

Is it possible to make the middle border as wide as the side borders?

.input-text {
  border-width: 10px !important;
}
<link href="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0/css/bootstrap.min.css" rel="stylesheet"/>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script>
<div class="centered-query">
    <div class="row justify-content-center">
        <div class="col-lg-9 col-12">
            <div class="input-group">
                <input type="text" class="form-control input-text">
                <input type="text" class="form-control input-text">
                <div class="input-group-append">
                    <button type="submit" class="btn">Go</button>
                </div>
            </div>
        </div>
    </div>
</div>

Upvotes: 0

Views: 629

Answers (1)

Nandita Sharma
Nandita Sharma

Reputation: 13407

Override the left/right border for the first and second input

.input-text {
  border-width: 10px !important;
}

.input-text.first {
  border-right-width: 5px !important;
}

.input-text.second {
  border-left-width: 5px !important;
}
<link href="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0/css/bootstrap.min.css" rel="stylesheet" />
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script>
<div class="centered-query">
  <div class="row justify-content-center">
    <div class="col-lg-9 col-12">
      <div class="input-group">
        <input type="text" class="form-control input-text first">
        <input type="text" class="form-control input-text second">
        <div class="input-group-append">
          <button type="submit" class="btn">Go</button>
        </div>
      </div>
    </div>
  </div>
</div>

Upvotes: 1

Related Questions