Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Set checkbox label to right side or fixed position

This is the code for a standard checkbox:

<fieldset data-role="controlgroup">
        <legend>Agree to the terms:</legend>
        <input type="checkbox" name="checkbox-1" id="checkbox-1" class="custom" />
        <label for="checkbox-1">I agree</label> 
</fieldset>

How can I set the label (text) of a checkbox to the right side or to a fixed "px" position?

Something like align-right or right: 50px

like image 588
PMe Avatar asked Feb 05 '13 12:02

PMe


1 Answers

If you have this controls in html file

<label for="2">Laparoscopic surgery</label>
<input type="checkbox" name="question" value="14" class="clickable" id="2"  />

It's enough to do this in css:

.clickable{
    float: left;
}
like image 62
user1510176 Avatar answered Oct 22 '22 22:10

user1510176