Sunday, May 19, 2024
 Popular · Latest · Hot · Upcoming
115
rated 0 times [  117] [ 2]  / answers: 1 / hits: 63430  / 12 Years ago, tue, february 5, 2013, 12:00:00

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


More From » jquery

 Answers
5

Add a classname or ID for the label like the following:



<label for=checkbox-1 class=chkbox>I agree</label>


Then add css rule for the class,



 .chkbox {
padding-left: 10px;
font-weight: bold;
}


You can give padding, border or whatever style u like for the label.



Demo: DEMO FIDDLE


[#80413] Monday, February 4, 2013, 12 Years  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.
leslijessalyng

Total Points: 650
Total Questions: 85
Total Answers: 109

Location: Croatia
Member since Mon, Sep 6, 2021
3 Years ago
leslijessalyng questions
Fri, Feb 21, 20, 00:00, 4 Years ago
Tue, Jul 30, 19, 00:00, 5 Years ago
Fri, Jul 5, 19, 00:00, 5 Years ago
Wed, Mar 13, 19, 00:00, 5 Years ago
;