gpt4 book ai didi

twitter-bootstrap - bootstrap3 缩略图网格

转载 作者:行者123 更新时间:2023-12-04 23:02:51 24 4
gpt4 key购买 nike

我找到了一个关于 Bootstrap 网格的教程,但它是用 bootstrap1.x 编写的。现在想用bootstrap3来达到同样的效果。文档说使用 .img 缩略图 而不是 .media-grid ,但它似乎仍然无法正常工作。我想要的是这样的:
enter image description here

1.x 版本是:

<ul class="media-grid">
<li>
<a href="#">
<img src="http://placehold.it/290x200" />
</a>
</li>
<li>
<a href="#">
<img src="http://placehold.it/290x200" />

</a>
</li>
<li>
<a href="#">
<img src="http://placehold.it/290x200" />
</a>
</li>

<!-- row of 4 thumbnails -->
<li>
<a href="#">
<img src="http://placehold.it/210x140" />
</a>
</li>
<li>
<a href="#">
<img src="http://placehold.it/210x140" />
</a>
</li>
<li>
<a href="#">
<img src="http://placehold.it/210x140" />
</a>
</li>
<li>
<a href="#">
<img src="http://placehold.it/210x140" />
</a>
</li>

</ul><!-- end media-grid -->

最佳答案

.img-thumbnail类应用于图像,因此它们具有圆形边框样式,它不能直接替代 .media-grid ,同样如果您希望将图像包含在链接中,那么您最好使用 .thumbnail链接本身的类为 described here .

要构建实际的网格,您需要使用 Bootstrap 3 的 new grid system ,您的示例将如下所示:

<div class="container">
<div class="row">
<div class="col-xs-4">
<a href="#" class="thumbnail">
<img src="http://placehold.it/400x200" alt="..." />
</a>
</div>
<div class="col-xs-4">
<a href="#" class="thumbnail">
<img src="http://placehold.it/400x200" alt="..." />
</a>
</div>
<div class="col-xs-4">
<a href="#" class="thumbnail">
<img src="http://placehold.it/400x200" alt="..." />
</a>
</div>
<div class="col-xs-3">
<a href="#" class="thumbnail">
<img src="http://placehold.it/300x150" alt="..." />
</a>
</div>
<div class="col-xs-3">
<a href="#" class="thumbnail">
<img src="http://placehold.it/300x150" alt="..." />
</a>
</div>
<div class="col-xs-3">
<a href="#" class="thumbnail">
<img src="http://placehold.it/300x150" alt="..." />
</a>
</div>
<div class="col-xs-3">
<a href="#" class="thumbnail">
<img src="http://placehold.it/300x150" alt="..." />
</a>
</div>
</div>
</div>

这是 demo fiddle

这是 another fiddle 如果您不需要链接,只需缩略图网格

关于twitter-bootstrap - bootstrap3 缩略图网格,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/18939958/

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