谷歌地图固定在foursquare之类的背景上 [英] Google map as fixed background like on foursquare

查看:144
本文介绍了谷歌地图固定在foursquare之类的背景上的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试执行诸如 。我想将谷歌地图作为固定背景,并将其内容(一些文本)放在它上面,因为它是在四方形成的。另外我想能够滚动我的内容。这是我的努力

I'm trying to do something like this. I want to have google map as a fixed background and place my content(some text) on it as it's made on foursquare. Also i want to be able to scroll my content. This is my 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;
}
​

但地图消失了。任何帮助将不胜感激。

But the map disappears. Any help will be appreciated.

推荐答案

以下是您可以执行此操作的一种方法: http://jsfiddle.net/X5r8r/927/

Here's a way you can do it: 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;
}

这篇关于谷歌地图固定在foursquare之类的背景上的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆