我正在尝试做类似 this 的事情.我想将谷歌地图作为固定背景,并将我的内容(一些文本)放在上面,因为它是在 foursquare 上制作的。我也希望能够滚动我的内容。这是我的effort :
#map
{
width: 100%;
height: 100%;
position: fixed;
top: 0;
left: 0;
bottom: 0;
right: 0;
z-index: 0;
}
#content
{
width: 200px;
margin: auto;
position: relative;
z-index: 1;
border: 4px solid black;
}
但是 map 消失了。任何帮助将不胜感激。
最佳答案
这里有一个方法可以做到:http://jsfiddle.net/X5r8r/927/
html, body {
height:100%;
}
#map-container {
width: 100%;
height: 100%;
position: fixed;
top: 0;
left: 0;
z-index: 0;
}
#map
{
width: 100%;
height: 100%;
}
#content
{
width: 200px;
position: absolute;
z-index: 1;
top:0;
left:0;
border: 4px solid black;
background:#fff;
padding:20px;
}
关于html - 谷歌地图作为 foursquare 上的固定背景,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/13588082/