我有一个背景图片,用窗口重新调整大小。我想要我的背景图片上的文字来表示链接。我的想法是创建空白透明的div,并将它们放在背景图片中的单词上,当单击div时,相应的链接将被激活。定位调整窗口大小时将移动的div
我无法定位我的div。当窗口重新调整大小时,我似乎无法让它们与背景图片中的单词保持一致。
HTML:
<div id="wrapper">
<div id="bespoke">
I want this to always be aligned with "Bespoke" in the background image
</div>
</div>
CSS:
html {
background: url(main.png) no-repeat center center fixed;
-webkit-background-size: cover;
-moz-background-size: cover;
-o-background-size: cover;
background-size: cover;
position: fixed;
}
#wrapper {
position: relative;
top: auto;
margin: auto;
text-align: center;
height: auto;
}
#bespoke {
}
演示:
注:如果jQuery是完成这一任务的最好方式,我不介意使用它。
标准图像映射有什么问题吗?他们不扩展吗? – cimmanon 2013-02-09 20:04:11
如果在重新调整窗口大小时重新调整图像大小,图像映射是否会工作? – Jon 2013-02-09 20:34:20