Reputation: 785
My view has a form. In this form I have this:
<div class="row">
{!! Form::label('math', 'Mathematics',
array('class' => 'col-xs-offset-4 col-lg-2 col-xs-5 text-right')) !!}
{!! Form::checkbox('exams[1]', '2')!!}
</div>
Now it's looks like this:
How to keep label and checkbox in one line?
Edit
Solved like this:
<div class="row">
<label class="col-xs-offset-4 col-lg-2 col-xs-5 text-right">Mathematics
{!! Form::checkbox('exams[1]', '2')!!}
</label>
</div>
Upvotes: 0
Views: 5011
Reputation: 954
When I run your code it's on the same line already, so you might wanna check if bootstrap is loaded.
as alternative you could add a class, like "mt10"
{!! Form::label('math', 'Mathematics',
array('class' => 'col-xs-offset-4 col-lg-2 col-xs-5 text-right')) !!}
{!! Form::checkbox('exams[1]', '2', null, array('class' => 'mt10'))!!}
And add some margin to the class (might be more or less pixels)
.mt10 { margin-top: 10px; }
Upvotes: 0
Reputation: 3157
Give a class or id to your field for example checkbox
{!! Form::checkbox('exams[1]', '2', false, ['class' => 'checkbox']) !!}
Now in your stylesheet code like this:
.checkbox {
margin-top: 5px; // try +/- the pixel, check what works for you
}
Upvotes: 1
Reputation: 447
give class or style to your checkbox
{!! Form::checkbox('exams[1]', '2', ['class' => 'asad'])!!}
Upvotes: 0