【发布时间】:2014-02-14 14:56:38
【问题描述】:
使用 Bootstrap 3,我想要一个方形平铺菜单,看起来像 Bootstrap 的缩略图 (http://getbootstrap.com/components/#thumbnails)。那里获得平铺显示的代码是:
<div class="col-md-3 col-sm-4 col-xs-6">
<a href="#x" class="thumbnail">
<img src="http://placehold.it/250x250" alt="Image" class="img-responsive">
</a>
</div>
我只想将 img 占位符替换为(垂直对齐的)html 文本。因此,我认为我可以做到以下几点:
<div class="col-md-3 col-sm-4 col-xs-6">
<a href="#x" class="thumbnail purple">Homepage</a>
</div>
<div class="col-md-3 col-sm-4 col-xs-6">
<a href="#x" class="thumbnail purple">View Profile</a>
</div>
<div class="col-md-3 col-sm-4 col-xs-6">
<a href="#x" class="thumbnail purple">Something 2 lines</a>
</div>
这就是我得到的:
占位符示例将每个图块动态塑造成方形图块,我希望在 html/css/js 中的我的图块也是这样。有可能吗,还是我必须在那里使用 img ?
【问题讨论】:
-
我可能错了,但这似乎不是重复的。 bootply 示例没有方形瓷砖。
-
问题是一样的:“如何创建响应式的方形 .thumbnail div”
标签: javascript html css twitter-bootstrap twitter-bootstrap-3