我试着按照这个问题的问题+答案来回答。Bootstrap4让卡头高度相同。但我不能让它工作。
我的html代码是这样的。
<div class="card-deck">
<div class="card m-xs-1 m-2" style="">
<div class="card-header" style="">
<div class="card-text text-left" style="">Lorem ipsum dolor sit amet, consectetur adipiscing elit. Pellentesque volutpat viverra odio pharetra lacinia.
</div>
</div>
<div class="card-body" style="">
<div class="card-text text-left" style="">
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Pellentesque volutpat viverra odio pharetra lacinia. Vestibulum mattis eros velit, hendrerit malesuada est hendrerit eget. Pellentesque urna quam, eleifend ut accumsan vel, feugiat et arcu. Curabitur consectetur tincidunt arcu, id sollicitudin erat egestas non
</div>
<div class="card-text text-left" style="">
<br>
</div>
</div>
<div class="card-footer" style="">
<div class="card-text text-muted text-left" style="">
<small>text</small>
</div>
</div>
</div>
<div class="card m-xs-1 m-2" style="">
<div class="card-header" style="">
<div class="card-text text-left" style="">
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Pellentesque volutpat viverra odio pharetra lacinia. Vestibulum mattis eros velit, hendrerit malesuada est hendrerit eget. Pellentesque urna quam, eleifend ut accumsan vel, feugiat et arcu. Curabitur consectetur tincidunt arcu, id sollicitudin erat egestas non
</div>
</div>
<div class="card-body" style="">
<div class="card-text text-left" style="">
Lorem ipsum dolor sit amet
</div>
<div class="card-text text-left" style="">
<br>
</div>
</div>
<div class="card-footer" style="">
<div class="card-text text-muted text-left" style="">
<small>text2</small>
</div>
</div>
</div>
</div>
使用下面的代码来满足你的要求。
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/4.5.0/css/bootstrap.min.css">
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.5.1/jquery.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/popper.js/1.16.0/umd/popper.min.js"></script>
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/4.5.0/js/bootstrap.min.js"></script>
</head>
<body>
<div class="card-deck">
<div class="card m-xs-1 m-2" style="">
<div class="card-header d-flex align-items-center h-100" style="">
<div class="card-text text-left" style="">Lorem ipsum dolor sit amet, consectetur adipiscing elit. Pellentesque volutpat viverra odio pharetra lacinia.
</div>
</div>
<div class="card-body d-flex align-items-center h-100" style="">
<div class="card-text text-left" style="">
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Pellentesque volutpat viverra odio pharetra lacinia. Vestibulum mattis eros velit, hendrerit malesuada est hendrerit eget. Pellentesque urna quam, eleifend ut accumsan vel, feugiat et arcu. Curabitur consectetur tincidunt arcu, id sollicitudin erat egestas non
</div>
<div class="card-text text-left" style="">
<br>
</div>
</div>
<div class="card-footer" style="">
<div class="card-text text-muted text-left" style="">
<small>text</small>
</div>
</div>
</div>
<div class="card m-xs-1 m-2" style="">
<div class="card-header d-flex align-items-center h-100" style="">
<div class="card-text text-left" style="">
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Pellentesque volutpat viverra odio pharetra lacinia. Vestibulum mattis eros velit, hendrerit malesuada est hendrerit eget. Pellentesque urna quam, eleifend ut accumsan vel, feugiat et arcu. Curabitur consectetur tincidunt arcu, id sollicitudin erat egestas non
</div>
</div>
<div class="card-body d-flex align-items-center h-100" style="">
<div class="card-text text-left" style="">
Lorem ipsum dolor sit amet.
</div>
<div class="card-text text-left" style="">
<br>
</div>
</div>
<div class="card-footer" style="">
<div class="card-text text-muted text-left" style="">
<small>text2</small>
</div>
</div>
</div>
</div>
</body>
</html>
我希望这对你有好处。
谢谢你的支持...