html - 谷歌地图作为 foursquare 上的固定背景

标签 html css google-maps foursquare

我正在尝试做类似 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/

相关文章:

php - 如何使用javascript隐藏子元素

php - 在偶数上添加 tr 元素

html - 如何在不使用简单的 HTML/CSS 或 XML 中使用 iFrame 或 PHP 的情况下重复菜单?

html - 页脚与内容 div 重叠

css - angularjs:ng-src 等效于背景图像:url(...)

javascript - Googlemaps api V3 加载 api 时出错

html - 如何将整个 pdf 页面背景色白色更改为 rails 中的其他颜色

php - Woocommerce 摘录 CSS 影响页面的其余部分

javascript - 谷歌地图 API v3 : Group markers?

python - 如何使用 python pygmaps 将 'title' 添加到 Google map 上映射的每个点?