简而言之,图像没有锚标签。这里有您需要做什么:
目前代码
的所有产品的HTML代码如下所示:
<div class="best-seller-wrap">
<div class="second-img">
<div class="disount-text">
30% OFF
</div>
<div class="price-text-wrap">
<h3>$34.99</h3>
<p>
<a href="http://modulesoft.info/projects/gamesite/?product=dishonered">Buy Now..</a>
</p>
</div>
</div>
</div>
而CSS是这样的:
#main .best-seller-wrap .second-img {
background-image: url('images/best-seller-images/img-2.png');
position: relative;
}
新代码
个
所有产品HTML:
<div class="best-seller-wrap">
<div style="position: relative">
<a class="second-img" href="http://modulesoft.info/projects/gamesite/?product=dishonered"></a>
<div class="disount-text">
30% OFF
</div>
<div class="price-text-wrap">
<h3>$34.99</h3>
<p>
<a href="http://modulesoft.info/projects/gamesite/?product=dishonered">Buy Now..</a>
</p>
</div>
</div>
</div>
CSS:
#main .best-seller-wrap .second-img {
background-image: url('images/best-seller-images/img-2.png');
position: relative;
display: block;
}
你会发现,我在申请您的.second-img
类锚标记,并添加display: block
到类:
<a class="second-img" href="http://modulesoft.info/projects/gamesite/?product=dishonered"></a>
另请注意,我将position: relative
添加到周围div
<div style="position: relative">
您的整个图像现在应该作为链接工作。
我也面临同样的问题...任何帮助请:) – 2013-02-13 06:17:34
我不知道我明白,您的问题是关于如何更改图像大小,使项目可点击或管理自定义内容?它基本上归结为控制输出的主题文件,我的猜测是index.php或front-page.php – LobsterMan 2013-02-14 18:11:01