Alan A Alan A - 1 year ago 76
CSS Question

Vertically aligning text next to a radio button

This is a basic CSS question, I have a radio button with a small text label after it. I want the text to appear centered vertically but the text is always aligned with the button of the radio button in my case.

<p><input type="radio" id="opt1" name="opt1" value="1" />A label</p>

Here is a Jsfiddle:

Any suggestions?



Answer Source

Use it inside a label. Use vertical-align to set it to various values -- bottom, baseline, middle etc.

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download