<分区>
标签 html css bootstrap-4
<分区>
所有按钮高度应该相同并且按钮内容应该垂直居中
.col-md-3{
margin-bottom:20px;
}
.btn{
border:1px solid #000;
white-space:initial;
padding:20px;
height:100%;
}
<link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.2.1/css/bootstrap.min.css" integrity="sha384-GJzZqFGwb1QTTN6wy59ffF1BuGJpLSa9DkKMp0DgiMDm4iYMj70gZWKYbI706tWS" crossorigin="anonymous">
<div class="container">
<div class="row align-items-stretch">
<div class="col-md-3"><a href="#" class="btn btn-block">Fundamentals of Mathematics </a></div>
<div class="col-md-3"><a href="#" class="btn btn-block">Fundamentals of Logical Reasoning - I </a></div>
<div class="col-md-3"><a href="#" class="btn btn-block link-circle">Fundamentals of Logical Reasoning - II </a></div>
</div>
</div>
最佳答案
使用显示: flex ;应用此 CSS
.btn
{
display:flex;
justify-content:center;
align-items:center;
}
关于html - 如何对齐按钮内容垂直对齐,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/54360418/