使用Google Maps API在div上创建div [英] div on top of div with Google Maps API

查看:122
本文介绍了使用Google Maps API在div上创建div的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何在Google Maps API地图div上方悬浮div菜单。也许可能在菜单div上添加50%的透明度。可以这样做吗?

How do I float a div "menu" on top of my Google Maps API "map" div. And maybe possibly add a transparency of 50% on the menu div. Can this be done?

#map {width: 835px; height 540px; float: left;}
#menu {width: 145px; float: right; padding-top: 10px;}

<div id="map"></div>
<div id="menu"></div>


推荐答案

c $ c> DIVs 像这样:

Can't you changed the positions of the DIVs like this:

<div id="menu"></div>
<div id="map"></div>

如果没有,你可以这样做:

If not you could go something like this:

<div id="map"></div>
<div id="menu"></div>

#menu
{
    position: absolute;
    top: 10px;  /* adjust value accordingly */
    left: 10px;  /* adjust value accordingly */
}

更新2

跨浏览器透明度样式:

.dropSheet
{
    background-color: #000000;
    background-image: none;
    opacity: 0.5;
    filter: alpha(opacity=50);
}

只需应用 dropSheet 到您要使其透明的元素。

Just apply the class dropSheet to the element you want to make transparent.

这篇关于使用Google Maps API在div上创建div的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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