David
David

Reputation: 17

Adjust label aside input

I have layout like this

<div class="form-group">
  <div class="col-md-12">
    <div class='col-md-6'>
      <div class="form-group">
        Date of ship:
        <div class='input-group date' id='datetimepicker1'>
          <input type='text' class="form-control" />
          <span class="input-group-addon">
           <span class="glyphicon glyphicon-calendar"></span>
          </span>
        </div>
      </div>
    </div>
    <div class="col-md-2">
      <input type="submit" value="Guardar" class="btn btn-xs" style="background-color:#3399FF;color:#FFFFFF" />
    </div>
  </div>
</div>

Demo

That I want to do is fix label "Date of ship" just a side of input instead above of it. How can I achieve it? Regards

Upvotes: 0

Views: 38

Answers (2)

Daniel
Daniel

Reputation: 60

First of all, they're in a col-md-6. Which is half the width of a full row. This isn't much space, but it should work, CSS:

label { float: left; }
input.form-control { float: left; }

Upvotes: 0

jonah_johnson
jonah_johnson

Reputation: 36

It's a simple matter of positioning it to the left side of the input field. You might have to decrease the size of the input box, or moving the input field to the left. To do this, you need CSS.

Upvotes: 1

Related Questions