【发布时间】:2011-07-08 06:39:33
【问题描述】:
我正在尝试创建一个高度为 '22px' 的按钮,并且按钮内的文本将在按钮的中心垂直对齐。我尝试了所有方法,但不知道该怎么做。
如何做到这一点?
更新: 这是我的代码:
CSS:
.test1 label {
float: left;
clear: left;
width:31%;
margin-right:-2px;
}
.test1 input {
float:left;
width:69%;
margin-right:-2px;
}
.testbutton {
float:left;
margin-left: 10px;
height: 22px;
line-height: 22px;
text-align:center;
background-color:#fbfbfb;
border:1px solid #b7b7b7;
color:#606060;
cursor:pointer;
display:inline-block;
font:bold 12px/100% Arial, sans-serif;
}
HTML:
<div class="test1">
<label for="test" title="test">test</label>
<input style="width:18px; float:left;" type="checkbox" name="test" id="test" tabindex="5" />
<input class="testbutton" id="testbutton" style="width:60px;"type="button" value="Import" /></div>
【问题讨论】: