【发布时间】:2015-04-15 19:52:58
【问题描述】:
我想在我的网站上添加一个 CartoDB 地图,使其位置固定并隐藏在主要内容后面。 我做的和下面的html/css很相似:
<style type="text/css">
#1stcontent{
position:relative;
z-index:10;
margin-bottom:100%;
margin-bottom:100vh;}
#map{
height:100%;
height:100vh;
width:100%;
width:100vw;
position:fixed;
top:0;
left:0;
}
#2ndcontent{
position:relative;
z-index:10;
}
</style>
<div id="1stcontent">1st content</div>
<div id="map"><iframe src="//cartodb.com…"></iframe></div>
<div id="2ndcontent">more content</div>
这对我来说在 Chrome 中非常有效,但在 Safari 中,#1stcontent 或 #2ndcontent div 隐藏在地图下方,而不是显示在地图上方的顶层。您可以在http://asyl.ungeruehrt.de/ 下查看该项目目前可用的位置。
希望能提供一些解决此问题的提示!
【问题讨论】:
标签: html css safari z-index cartodb