以下 HTML 生成未对齐的按钮,中间的按钮比其他两个按钮高,因为文本被换行了。我怎样才能使它们对齐?
<html>
<head>
<title>Status</title>
<style type="text/css">
.btn {
background-color:red;
font:bold 14px Arial;
width:200;
height:100;
background-color:green;
}
</style>
</head>
<center>
<br>
<form>
<button type=button class=btn onClick="#">Button 1<br>None</button>
<button type=button class=btn onClick="#">Really Long Wrapped Button 2<br>None</button>
<button type=button class=btn onClick="#">Button 3<br>None</button>
</form>
</center>
</html>
最佳答案
由 OP 解决:
请参阅下面的垂直对齐标签。
<style type="text/css">
.btn {
background-color:red;
font:bold 14px Arial;
width:200;
height:100;
background-color:green;
vertical-align: middle;
}
</style>
关于HTML 按钮垂直对齐,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/20617848/