1

I am new to bootstrap. I have the following bootstrap form:

<form class="form-inline " style="display: inline-block">

   <div class="form-group" >
      <input type="text" class="form-control input-lg" id="inputEmail"  placeholder="full names..."
                                    style="margin: 25px">
   </div>



   <div class="form-group">
        <input type="email" class="form-control input-lg" id="inputEmail" placeholder="email address..."style="margin: 25px">
   </div>

   <button type="submit" class="btn btn-primary mx-auto">Sign Up</button>

</form>

I want to make the text box wider: When I custom style the width then it ceases to be responsive for small windows. The width doesn’t collapse to fit the small screens.

Your suggestion below:

<div class="container">
  <div class="row">
    <div class="col">

      <form class="form-inline " style="display: inline-block">



        <div class="form-group">
          <input type="text" class="form-control input-lg" id="inputEmail" placeholder="Enter full names..." style="margin: 25px;width:400px">
        </div>



        <div class="form-group">
          <input type="email" class="form-control input-lg" id="inputEmail" placeholder="Enter email address..." style="margin: 25px;width:400px">
        </div>

        <button type="submit" class="btn btn-primary mx-auto">Sign Up</button>

      </form>
    </div>
  </div>
</div>
Adriano
  • 3,788
  • 5
  • 32
  • 53
Screwtape007
  • 185
  • 1
  • 2
  • 16

2 Answers2

0
<div class="container">
<div class="row">
<div class="col">
<form class="form-inline " style="display: inline-block">
<div class="form-group" >
  <input type="text" class="form-control input-lg" id="inputEmail" placeholder="full names..." style="margin: 25px">
</div>
<div class="form-group">
    <input type="email" class="form-control input-lg" id="inputEmail" placeholder="email address..."style="margin: 25px">
 </div>
 <button type="submit" class="btn btn-primary mx-auto">Sign Up</button>
 </form>

</div>
</div>
</div>

Messy but it can do the Job!

abrsh
  • 454
  • 1
  • 6
  • 14
0

Based on your provided website, you are breaking the responsiveness by using fixed margin: 25px; and width: 300px;

I would solve it by using media queries:

@media (min-width: 430px) {
  input {
    margin: 25px;
    width: 300px;
  }
}

the breakpoint is specific for your case! Generally, I would recommend the bootstrap breakpoints.

Mario Kurzweil
  • 490
  • 6
  • 11