html - 谷歌地图作为背景

标签 html google-maps css

有没有一种性感的方式来获取带有 Google map 的网页(全屏),并且只有顶部的小 div#header 和中间的小 div#container?

我做了一些研究,发现了这个例子:http://koti.mbnet.fi/ojalesa/exam/index.html ... 但这并不是我想要做的。

如果您有一个不错的网站示例的精简代码示例,这将对我有很大帮助。

非常感谢。

最佳答案

您可以使用 position: absoluteposition: fixed 将 HTML 元素随机放置在(基于 HTML 的)Google map 之上。您只需为它们提供一个高于 Google map 中任何元素的 z-index

未经测试,但按照这些思路应该可以工作:

<style type="text/css">
  .Overlay { position: absolute; left: 0px; top: 0px; 
             right: 0px; height: 50px; background-color: white; z-index: 100 }
</style>

... Fullscreen Google Map (or whatever)..... 

<div class="Overlay">I'm on top of a Google Map!</div>

关于html - 谷歌地图作为背景,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/2594946/

相关文章:

javascript - 如何将此元素传递给 javascript onclick 函数并向该单击的元素添加一个类

javascript - 在 BlackBerry WebWorks 应用程序中显示 Google map

javascript - 如何在自定义 ImageMapType 实现中针对某些缩放级别拉伸(stretch)图 block ?

google-maps - 计算谷歌地图的昼夜叠加

css - 如何选择最后一个 child 的最后一个 child ?

html - 如何在同一行制作3张图片,然后在下面制作3段

html - 多复选框管理

javascript - 重新加载后如何显示复选框中选中的项目的勾号?

css - 正则表达式 : extract css class out of string with multiple classes

html - 背景图片不会重复全高