gpt4 book ai didi

html - 使不同尺寸的容器在 Bootstrap 中正确对齐

转载 作者:行者123 更新时间:2023-11-28 16:58:08 24 4
gpt4 key购买 nike

我有一个博客网站,它使用 bootstrap 编写和提交帖子以及索引页面。

显然,缩略图大小不同,除非使用标准图像大小,否则它们的长度也会不同。

这是标准的样子: enter image description here

这是一个比另一个长时的样子: enter image description here

我想把最左下角的博文移到左上角。

这是我使用的 html:

<section>
<div class="container">
<div class="col-md-8">
<div class="col-md-6">
<div class="thumbnail">
<img src="img/thumbnailbig.png" alt="...">
<div class="caption">
<h3>Thumbnail label</h3>
<h4>Written by LCBradley3k</h4>
<p>Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book.</p>
<p><a href="show.html" class="btn btn-primary btn-block" role="button">Read More</a></p>
</div>
</div>
</div>
<div class="col-md-6">
<div class="thumbnail">
<img src="img/thumbnailbig.png" alt="...">
<div class="caption">
<h3>Thumbnail label</h3>
<h4>Written by LCBradley3k</h4>
<p>Lorem Ipsum is simply dummy text o</p>
<p><a href="show.html" class="btn btn-primary btn-block" role="button">Read More</a></p>
</div>
</div>
</div>
<div class="col-md-6">
<div class="thumbnail">
<img src="img/thumbnailbig.png" alt="...">
<div class="caption">
<h3>Thumbnail label</h3>
<h4>Written by LCBradley3k</h4>
<p>Lorem Ipsum is simply dummy text o</p>
<p><a href="show.html" class="btn btn-primary btn-block" role="button">Read More</a></p>
</div>
</div>
</div>
<div class="col-md-6">
<div class="thumbnail">
<img src="img/thumbnailbig.png" alt="...">
<div class="caption">
<h3>Thumbnail label</h3>
<h4>Written by LCBradley3k</h4>
<p>Lorem Ipsum is simply dummy text o</p>
<p><a href="show.html" class="btn btn-primary btn-block" role="button">Read More</a></p>
</div>
</div>
</div>

</div>
<div class="col-md-4">
<div class="list-group">
<a href="#" class="list-group-item active"><span class="badge">14</span>
Map Building
</a>
<a href="#" class="list-group-item"><span class="badge">14</span>Crafting</a>
<a href="#" class="list-group-item"><span class="badge">28</span>Servers</a>
<a href="#" class="list-group-item"><span class="badge">10</span>3d Modeling</a>
<a href="#" class="list-group-item"><span class="badge">2</span>Clothing</a>
</div>
</div>

我知道行在 bootstrap 中很常用,但我把它们去掉了,一切还是一样。我如何才能达到让博客文章紧密结合在一起的效果?

最佳答案

<!DOCTYPE html>
<html>
<head>
<title></title>
<!-- Latest compiled and minified CSS -->
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.5/css/bootstrap.min.css">

<!-- Optional theme -->
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.5/css/bootstrap-theme.min.css">

<!-- Latest compiled and minified JavaScript -->
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.5/js/bootstrap.min.js"></script>
</head>
<body>
<style type="text/css">
.pc{


height: auto;
max-height: 20px;
overflow: hidden;


}
</style>





<section>
<div class="container">
<div class="col-md-8">
<div class="col-md-6">
<div class="thumbnail">
<img src="img/thumbnailbig.png" alt="...">
<div class="caption">
<h3>Thumbnail label</h3>
<h4>Written by LCBradley3k</h4>
<p class="pc">Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book.</p>
<p><a href="show.html" class="btn btn-primary btn-block" role="button">Read More</a></p>
</div>
</div>
</div>
<div class="col-md-6">
<div class="thumbnail">
<img src="img/thumbnailbig.png" alt="...">
<div class="caption">
<h3>Thumbnail label</h3>
<h4>Written by LCBradley3k</h4>
<p class="pc">Lorem Ipsum is simply dummy text o</p>
<p><a href="show.html" class="btn btn-primary btn-block" role="button">Read More</a></p>
</div>
</div>
</div>
<div class="col-md-6">
<div class="thumbnail">
<img src="img/thumbnailbig.png" alt="...">
<div class="caption">
<h3>Thumbnail label</h3>
<h4>Written by LCBradley3k</h4>
<p class="pc">Lorem Ipsum is simply dummy text o</p>
<p><a href="show.html" class="btn btn-primary btn-block" role="button">Read More</a></p>
</div>
</div>
</div>
<div class="col-md-6">
<div class="thumbnail">
<img src="img/thumbnailbig.png" alt="...">
<div class="caption">
<h3>Thumbnail label</h3>
<h4>Written by LCBradley3k</h4>
<p class="pc">Lorem Ipsum is simply dummy text o</p>
<p><a href="show.html" class="btn btn-primary btn-block" role="button">Read More</a></p>
</div>
</div>
</div>

</div>
<div class="col-md-4">
<div class="list-group">
<a href="#" class="list-group-item active"><span class="badge">14</span>
Map Building
</a>
<a href="#" class="list-group-item"><span class="badge">14</span>Crafting</a>
<a href="#" class="list-group-item"><span class="badge">28</span>Servers</a>
<a href="#" class="list-group-item"><span class="badge">10</span>3d Modeling</a>
<a href="#" class="list-group-item"><span class="badge">2</span>Clothing</a>
</div>
</div>
</body>
</html>

关于html - 使不同尺寸的容器在 Bootstrap 中正确对齐,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/31752196/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com