2013-05-22 10 views

Odpowiedz

3

odpowiedzieć za rok 2015:
Od vertical-align nie działa dla mnie (lub nie więcej), oto jak to zrobić:

<!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> 

Zobacz http://jsfiddle.net/8jzss08p/
10 Działa w: Firefox 41, Chrome 45, Internet Explorer 11