如何使整个引导程序缩略图可点击(适用于手机和平板电脑)

时间:2014-06-18 02:58:40

标签: twitter-bootstrap hover thumbnails

使用Bootstrap3,我试图制作一个包含很少缩略图的页面,从而导致不同的链接。 我已经想出如何使用文本和链接制作悬停效果,但现在我很困惑如何将它与移动设备和平板电脑一起使用,因为它们没有悬停。

我想知道如何使整个缩略图可点击? 做到这一点是个好主意吗?

这是一个bootply链接,供您查看我的意思 http://www.bootply.com/OuUBXv4ope

1 个答案:

答案 0 :(得分:10)

使整个缩略图可点击是一个好主意,在用户可访问性方面,实际上,易于制作。

根据你的代码:

<div class="col-sm-4">
    <div class="thumbnail">
        <!-- Place the anchor tag here to cover both your caption and image -->
        <a href="#" class="">
            <div class="caption">
                <h4 class="">Thumbnail Headline</h4>
                <p class="">Lorem ipsum dolor
                </p>
            </div>
            <img src="http://lorempixel.com/400/300/technics/1/" alt="..." class="">
        </a>
        <!-- Anchor tag ends covering both image and caption -->
    </div>
</div>

DEMO (前3个缩略图)