Thumbnail 组件主要用于显示图片列表及图文混排列表。
在 <img>
添加 .am-thumbnail
类;也可以在 <img>
外面添加一个容器,如 <div>
、<figure>
、<a>
等,再将 class 添加到容器上。
<div class="am-g">
<div class="col-sm-4">
<img class="am-thumbnail" src="..." alt=""/>
</div>
<div class="col-sm-4">
<a href="#" class="am-thumbnail">
<img src="..." alt=""/>
</a>
</div>
<div class="col-sm-4">
<figure class="am-thumbnail">
<img src="..." alt=""/>
</figure>
</div>
</div>
Block Grid 默认没有边距,需自行设置。
<ul class="sm-block-grid-3">
<li>
<img class="am-thumbnail" src="..." alt=""/>
</li>
<li>
<a href="#" class="am-thumbnail">
<img src="..." alt=""/>
</a>
</li>
<li>
<figure class="am-thumbnail">
<img src="..." alt=""/>
</figure>
</li>
</ul>
<div class="am-g">
<div class="col-sm-4">
<div class="am-thumbnail">
<img src="..." alt=""/>
<h3 class="am-thumbnail-caption">图片标题 #1</h3>
</div>
</div>
<div class="col-sm-4">
<a href="#" class="am-thumbnail">
<img src="..." alt=""/>
<figcaption class="am-thumbnail-caption">图片标题 #2</figcaption>
</a>
</div>
<div class="col-sm-4">
<figure class="am-thumbnail">
<img src="..." alt=""/>
<figcaption class="am-thumbnail-caption">图片标题 #3</figcaption>
</figure>
</div>
</div>
在am-thumbnail
内加入.am-caption
可以添加任何类型的HTML内容标题、段落、或按钮。
<div class="am-g">
<div class="col-sm-6">
<div class="am-thumbnail">
<img src="..." alt=""/>
<div class="am-thumbnail-caption">
<h3>图片标题</h3>
<p>...</p>
<p>
<button class="am-btn am-btn-primary">按钮</button>
<button class="am-btn am-btn-default">按钮</button>
</p>
</div>
</div>
</div>
<div class="col-sm-6">
<div class="am-thumbnail">
<img src="..." alt=""/>
<div class="am-thumbnail-caption">
<h3>图片标题</h3>
<p>...</p>
<p>
<button class="am-btn am-btn-primary">按钮</button>
<button class="am-btn am-btn-default">按钮</button>
</p>
</div>
</div>
</div>
</div>