See http://jsbin.com/ocutob/1/edit
<span>
<input checked="checked" type="checkbox" value="1">
<label>test test test test test test test test test test test test </label>
</span>
How can align the checkbox at the: top, bottom and middle?
I would do it with another container and using positioning, but is there a simpler way?
Answer for 2015:
Since vertical-align
doesn't work for me (or not anymore), here's how I do it:
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>Radiobutton labels aligned</title>
<style type="text/css">
div { display:table-row; }
div span { display:table-cell; vertical-align:middle; } /* You can omit the entire span if you don't want the radiobutton vertically centered */
div label { display:table-cell; }
</style>
</head>
<body>
<form>
<div>
<span><input type="checkbox" id="a"></span>
<label for="a">First button's label<br>First button's label</label>
</div>
<div>
<span><input type="checkbox" id="b"></span>
<label for="b">Second button's label</label>
</div>
<input type="checkbox" id="c"><label for="c">For comparison: Standard-Label</label>
</form>
</body>
</html>
See http://jsfiddle.net/8jzss08p/
Works in: Firefox 41, Chrome 45, Internet Explorer 11
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With