checkbox div 对齐显示,解决checkbox和文字不对齐的方法
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN""http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtm">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<title>checkbox和文字对齐水平显示</title>
<style>
*{ margin:0; padding:0;}
body{font-family:宋体;font-size:12px;line-height: 20px;}
/*checkbox和文字对齐水平显示 方法1*/
.content{vertical-align:middle;line-height: 20px;}
.content input{vertical-align:middle;}
.content span{vertical-align:middle;margin-left: 5px;}
/*checkbox和文字对齐水平显示 方法2*/
.content2{line-height: 20px;}
.content2 input{display:block;margin-top: 3px; float:left;}
.content2 span{display:block; float:left;margin-left: 5px;}
</style>
</head>
<body>
<div class="content" >
<input name="" type="checkbox" value="登录了啊" checked="checked" /><span>登录了啊</span>
<input name="" type="checkbox" value="计算机天堂" /><span>计算机天堂 </span>
<input name="" type="checkbox" value="www.jsjtt.com" /><span>www.jsjtt.com</span>
</div>
<!--checkbox和文字对齐水平显示 方法2-->
<div class="content2" >
<input name="" type="checkbox" value="登录了啊" checked="checked" /><span>登录了啊</span>
<input name="" type="checkbox" value="计算机天堂" /><span>计算机天堂 </span>
<input name="" type="checkbox" value="www.jsjtt.com" /><span>jsjtt.com</span>
</div>
</body>
</html>
来源://作者:/更新时间:2012-12-11
顶
踩
相关文章:




![box-shadow[css3.0参考手册]](/d/file/webkaifa/CSS/2012-11-09/67f47fb6ec0346889fbde7fd4dab0eef.jpg)