需要给网站banner加跳转链接,应该怎么写?代码如下

<div class="bannerBox">
<div id="flashs">
<div
class="bgitem" id="flashbg0" style="background: url('/img/barnerBox.jpg') no-repeat scroll center top;
height: 500px; width: 100%; cursor: pointer; margin: 0 auto;"> </div>
<div
class="bgitem" id="flashbg1" style="background: url('/img/ad2.jpg') no-repeat scroll center top;
height: 500px; width: 100%; cursor: pointer; margin: 0 auto;"> </div>
<div
class="bgitem" id="flashbg2" style="background: url('/img/ad3.jpg') no-repeat scroll center top;
height: 500px; width: 100%; cursor: pointer; margin: 0 auto;"> </div>
<div
class="bgitem" id="flashbg3" style="background: url('/img/ad5.jpg') no-repeat scroll center top;
height: 500px; width: 100%; cursor: pointer; margin: 0 auto;"> </div>
<script type="text/javascript" src="/JS/flash.js"></script>
</div>
这是代码,需要在哪里加

把图片单独写出来,不要在CSS里做背景就可以了。
温馨提示:答案为网友推荐,仅供参考
第1个回答  2017-08-03

按照你的代码只能用我这种方法  给每个DIV后面加一个onclick事件,如下代码

<div onclick="window.location.href= '你要跳转的链接';return false">

追问

加在那里啊?

本回答被提问者和网友采纳
相似回答