Html 使整个背景广告可点击

Html 使整个背景广告可点击,html,css,Html,Css,我放置了一个背景图像(作为广告),并将其链接到一个外部网站。但并不是所有的图片都链接到它,只是其中的一小部分 我使用了a风格: <div id="bgb" align="center"> <a style="display:block; position:relative; left:0; top:0; width:100%; height:100%; cursor:pointer" href="http://www.datura.com/new" alt="

我放置了一个背景图像(作为广告),并将其链接到一个外部网站。但并不是所有的图片都链接到它,只是其中的一小部分

我使用了a风格:

         <div id="bgb" align="center">
<a style="display:block; position:relative; left:0; top:0; width:100%; height:100%; cursor:pointer" href="http://www.datura.com/new" alt="datura"><img src="http://taoofsophia.blogandthecity.net/wp-content/uploads/sites/2/Bg-adv-Datura-3-2.png" style="z-index:-9000"/></a></div>

但这不起作用。。有人知道怎么做?

可以尝试以下方法:

<div id="bgb" style="margin: 0 auto; position: relative; width: 640px; height: 315.5px">
    <a href="http://www.datura.com/new" alt="datura">
         <img src="http://taoofsophia.blogandthecity.net/wp-content/uploads/sites/2/Bg-adv-Datura-3-2.png" style="display:block; position:absolute; left:0px; top:0px; width:100%; height:100%; cursor:pointer;"/>
    </a>
</div>


你也可以试试这个

谢谢卢卡,但还没有成功。是否只有相对位置才有可能?我想我需要一个固定的位置,甚至可以让背景可见。我想可能是我的网站中的某些东西导致它不能正常工作。。我的网站可能会有人立即发现问题所在..flex控件导航{margin:0 0 5px;display:inline block;zoom:1;*display:inline;}为什么在display之前有一个*?再说一遍,为什么会有这个字符串:text shadow:1px 1px f1f0f0;*/没有评论效果?