Follow

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use
Contact

Bootstrap grid columns does not seem to be working properly

I’m using Bootstrap 3 and I have set up this grid for my webpage:

<div class="container">
    <div class="header">
         <div class="top-nav">
              <div class="row">
                   <div class="col-1">
                        <img src="https://sitename.com/logo.jpg">
                   </div>
                   <div class="col-7 mid-nav">
                        <!-- Search box & Navbar comes here -->
                   </div>
                   <div class="col-1" style="margin-top:30px !important;">
                        <a href="#"><i class="fa fa-shopping-cart fa-4x sabad-kharid"></i></a>
                   </div>
                   <div class="col-3">
                        <form method="POST" action="">
                           <div class="form-group">
                               <input type="email" class="form-control" id="exampleInputEmail1" aria-describedby="emailHelp" placeholder="Enter email">
                           </div>
                           <div class="form-group">
                               <input type="password" class="form-control" id="exampleInputPassword1" placeholder="Password">
                           </div>
                           <button type="submit" class="btn btn-primary">Submit</button>
                        </form>
                  </div>
             </div>
         </div>
     </div>
</div>

And the result is shown in this screenshot.

As you can see the Bootstrap form does not appear in the col-3 class and it appears at the below of this row. However it should be placed at the left side in the div with class of col-3.

MEDevel.com: Open-source for Healthcare and Education

Collecting and validating open-source software for healthcare, education, enterprise, development, medical imaging, medical records, and digital pathology.

Visit Medevel

So what’s going wrong here? How can I solve this issue?

>Solution :

You should use col-xs-1 col-xs-7 col-xs-3 in your class (instead col-7) or any size and display what you want.

Add a comment

Leave a Reply

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use

Discover more from Dev solutions

Subscribe now to keep reading and get access to the full archive.

Continue reading