nikhil gumidelli nikhil gumidelli - 1 month ago 6
CSS Question

How to display p tag and input on the same line

My current code is :

<div class="row" id="loginForm">
<p>Username : </p>
<input type="text" class="form-control input" id="usr">
</div>


This shows the input box in the next line, how can i display the p tag and the input box on the same line?

Answer

Use Bootstrap form-horizontal

<form class="form-horizontal">
    <div class="form-group">
      <label class="control-label col-sm-2" for="usr">Username:</label>
      <div class="col-sm-10">
        <input type="text" class="form-control input" id="usr">
      </div>
    </div>
</form>
Comments