3

私はこのようなことをしようとしています。固定の背景としてグーグルマップを持ち、フォースクエアで作成されたコンテンツ(一部のテキスト)をその上に配置したいと思います。また、コンテンツをスクロールできるようにしたいです。これは私の努力です:

#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;
}
​

しかし、地図は消えます。どんな助けでもありがたいです。

4

1 に答える 1

9

これを行う方法は次のとおりです。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;
}
于 2012-11-27T16:37:14.043 に答える