我想创建一个高度为'22px'的按钮,并且按钮中的文本将垂直对齐按钮的中心。我尝试了一切,但无法找到如何去做。html垂直对齐输入类型按钮内的文本
这怎么办?
UPDATE: 这是我的代码:
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>
[如何居中文本在自定义按钮?](http://stackoverflow.com/questions/16667536/how-align-center-text-in-custom-buttons) – Pensierinmusica 2016-07-26 09:21:13