center - Centering multiple input elements with equal space in CSS -
i've got radio buttons text. how can center stuff, first button same 'margin-left' 'margin-right' of last letter of p of last input?
html
<div class='someclass'> <input type='radio' name='somename'>example <input type='radio' name='somename'>other text </div> css
.someclass{ width:400px} .someclass input{ float:left}
you may use display: inline-block elements put theme in line, still keep wide box model properties margin, padding, etc them:
.someclass{ text-align: center; } .someclass .inputs{ display: inline-block; } <div class='someclass'> <p class="inputs"><input type='radio' name='somename'>example</p> <p class="inputs"><input type='radio' name='somename'>other text</p> </div>
Comments
Post a Comment