2

所以,我需要我的标题的两个小部分是可点击的。问题是我不能使用地图标签,因为我的图像在 css 中设置为 div 的背景。而且我不允许更改它(改为使用 img src )。我怎么能做到这一点,而不使用图像后面两个 div 的绝对定位。

CSS:

#bg_top { /*the design for the header*/
    background:url(../images/header_bg_new.png) center top  no-repeat;
    min-height: 100%; /*stick footer to bottom of the page*/
    text-align:left;
    width:100%;
4

1 回答 1

3

他们是解决这个问题的诀窍......

在 div#bg_top 添加一个透明 gif 图像,其尺寸应为 1x1,然后在 img 标签中指定其宽度和高度...

<div id="bg_top"><img src="spacer.gif" width="100%" height="100%" /></div>

然后在其中添加地图标签...这是您可以使用的简单技巧...

您也可以通过 jquery 应用 img 标签,

$("#bg_top").html("<img src='spacer.gif' width='100%' height='100%' />");

从此链接下载图片:- Spacer.gif

于 2012-07-16T07:48:06.957 回答