我正在尝试将表格放在谷歌地图上。地图显示正确但覆盖了表单。 here is the fiddle。它是整洁的形式,内部没有任何东西。
.map-wrapper {
position:relative;
height:500px;
z-index:0;
}
.map-canvas {
background-color:#00FFFF; /*FOR TRIAL ONLY*/
width:100%;
z-index:2;
color: #29383F;
position:absolute;
height:100%;
left:0;
top:0;
right:0;
clear:both;
}
#ff {z-index:50000;} /*not originally part of my code but tried anyway. failed */
#ff input.short{display:block;width:50%;border-radius:4px;-webkit-border-radius:4px;-moz-border-radius:4px;color:#000; border:1px solid #AFAFAF;padding:12px;margin: 5px 0 10px 0;font-size: 16px;max-height: 45px;}
#ff .sendButton {cursor:pointer;background-color: transparent;width:15%;color:#333;border: 3px solid #333;color: #333;font-size: 20px;padding: 8px 0 10px;}
和我的html简单地说:
<div class="map-wrapper">
<div class="map-canvas" id="map-canvas">Loading map...</div>
<form id="ff" name="ff" action="#" class="contact-form" method="post" accept-charset="utf-8">
<input type="text" name="from" id="from" class="short" placeholder="Your Name" required="required" autofocus="autofocus" value="" /><br/><br/>
<input type="email" name="fromemail" id="fromemail" class="short" placeholder="Your Email" required="required" value="" /><br/><br/>
<input class="sendButton send-mailbtn" type="submit" name="submit" id="submit" value="Submit"><br/><br/>
</form>
</div>
我在画布上尝试了不透明度,但正如预期的那样,它会影响地图的可见性。
有什么线索吗?
答案 0 :(得分:0)
你可以试试样式吗?
form {
z-index: 3;
position: absolute;
left: 0;
right: 0;
top: 0;
}
答案 1 :(得分:0)