简体   繁体   English

将div放在googlemap上方?

[英]Put a div on top of a googlemap?

Is there a plugin to do this or method to do this? 有插件可以做到这一点或方法吗?

See, I have this site and if you scroll to the bottom, you'll see a map. 看,我有这个网站 ,如果滚动到底部,您会看到一张地图。 What I want to do is to place a small box on top of the map, just like an overlay that will contain contact information. 我要做的是在地图上方放置一个小框,就像一个包含联系信息的叠加层一样。

Edit: Box will be on top of the watery part. 编辑:框将在含水部分的顶部。 :) :)

You can try this: 您可以尝试以下方法:

<div class="section" id="contact">
    <div style="width:100px; height:200px; background:#ccc;z-index:999999;position:absolute;">test</div>
</div>

Add a div after your section div as my above code...and position set as you want from top and left..(eg: Add this - top:"you need"; left:"you need";) 作为我上面的代码,在您的div部分之后添加一个div ...并根据需要从顶部和左侧设置位置。(例如:添加此内容-顶部:“您需要”;左侧:“您需要”;)

Good luck 祝好运

Something like this (without using inline styles obviously): 这样的事情(显然不使用内联样式):

<div id="googleMapContainer" style="height: 400px; position: relative;">
    <div id="overlay" style="height: 300px; width: 25%; max-width: 340px; position: absolute; top: 50px; left: 0px; background-color: rgba(0, 0, 0, 0.7); box-sizing: border-box; padding: 20px; color: #ffffff;">
        <p><a style="color: #f1f1f1;">Here's a link in your overlay</a></p>
    </div>
    <div class="google_map" id="map_canvas" style="width: 100%; height: 400px; margin: 0;"></div>
</div>

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM