CSS- Changing the width of a search box


I’d been trying to change the width of the search box in name="size" of my HTML template but can’t do it even when I tried width:.


<form class="form" method = "POST" >

        <h1>Soccer Shoes Finder</h1>
        <div class="line-separator"></div>

            <div class="container-fluid form-inline">

                <input class="form-control" name = "name" type="text" placeholder="Name"/>
                <input class="form-control" name = "size" type="text" placeholder="Size"/>
                <button class="form-control fa fa-search" aria-hidden="true"></button>


css of the element:

  width: 50%;

Here’s a codepen for better context:



I recommend using this method.

<form class="form" method="POST">

  <h1 class="text-center">Soccer Shoes Finder</h1>
  <div class="line-separator"></div>

  <div class="container ">

    <div class="row">
      <div class="col-md-4">
        <input class="form-control" name="name" type="text" placeholder="Name" />
      <div class="col-md-7">

        <input class="form-control" name="size" type="text" placeholder="Size" /></div>

      <div class="col-md-1">
        <button class="form-control " aria-hidden="true"><i class="fa fa-search"></i></button></div>



Updated Codepen:

Answered By – Aslam

Answer Checked By – Gilberto Lyons (AngularFixing Admin)

Leave a Reply

Your email address will not be published.