嘿,我有一個我一直在建設的電子商務網站,他們決定在我的後續商標中加入一個PayPal賬單,其中大約有900個。所以我剛創建了一個背景圖片放置在添加購物車按鈕的下方。我這樣做了,所以我不需要通過900多種產品的整合。是否有可能通過CSS中的背景圖像創建鏈接
那麼我可以創建一些代碼或其他東西來鏈接它嗎?這將是一個通用鏈接,對於每個產品上的每個圖像都是一樣的。
CSS代碼:
.singular .pricing {
padding-left:0;
padding-bottom: 4em;
background-image: url(http://www.prodjsoundlighting.com/wp-content/uploads/2012/12/render.png);
background-position: bottom left;
background-repeat: no-repeat;
background-size: 15em;
}
所以我想創建上述背景圖像變成可點擊的鏈接,而不要去到每一個產品,並創建一個鏈接它。
聖誕快樂!!!
更新:
樣本HTML
<div class="prodslideshow">
<div class="slidecontainer">
[superzoomgallery]
</div>
</div>
<div class="item-post"><a href="/">
<div class="prod-image-cont">
<img src="" alt="" width="145px" height="160px" />
</div></a>
<div class="discription"></div>
<div class="pricing">
<h2 class="producthover"></h2>
<h2></h2>
[wp_cart:led-par-56-24-uvb:price:329.99:end]
</div>
</br></br></br></br></br>
<div class="prodinfo">
<h3 style="color:black; font-weight:bold;">About:<br/></h3>
<br/>
<h3 style="color:black; font-weight:bold;">Features:<br/></h3>
<br/>
<h3 style="color:black; font-weight:bold;">Specifications:<br/></h3>
</div>
</div>
背景圖像會在這裏:
<div class="pricing">
<h2 class="producthover"></h2>
<h2></h2>
[wp_cart:led-par-56-24-uvb:price:329.99:end]
</div>
這是每一個個體產品的HTML模板。
HTML模板爲每一個產品在所有影響每一個是這樣的:
<div id="primary">
<div id="content" role="main">
<div class="singlepostcontent">
<?php while (have_posts()) : the_post(); ?>
<nav id="nav-single">
<h3 class="assistive-text"><?php _e('Post navigation', 'twentyeleven'); ?></h3>
<span class="nav-previous"><?php previous_post_link('%link', __('<span class="meta-nav">←</span> Previous', 'twentyeleven')); ?></span>
<span class="nav-next"><?php next_post_link('%link', __('Next <span class="meta-nav">→</span>', 'twentyeleven')); ?></span>
</nav><!-- #nav-single -->
<?php get_template_part('content', 'single'); ?>
<?php comments_template('', true); ?>
<?php endwhile; // end of the loop. ?>
</div><!-- .singlepostcontent -->
</div><!-- #content -->
</div><!-- #primary -->
您可以發佈您的示例HTML代碼段嗎? – Eli
通過純粹的CSS簡單地NO,你必須是小結構。 – Jai
我可以使用JQuery或Java來完成此操作嗎? –