【发布时间】:2020-10-27 12:44:43
【问题描述】:
我想要一个始终出现在视图中心的弹出窗口。如果我将地图向右移动一点,比如 Boxhill,然后单击按钮,则很难看到弹出窗口。我该如何解决这个问题?
https://jsfiddle.net/dendi_lee1996/j985mpvz/20/
HTML
<div id="map"></div>
<nav id="button"></nav>
CSS
body {
margin: 0;
padding: 0;
}
#map {
position: absolute;
top: 0;
bottom: 0;
width: 100%;
}
#button {
background: #fff;
position: absolute;
z-index: 1;
top: 10px;
right: 10px;
border-radius: 3px;
width: 120px;
border: 1px solid rgba(0, 0, 0, 0.4);
font-family: 'Arial', sans-serif;
}
#button tab {
font-size: 13px;
color: #404040;
display: block;
margin: 0;
padding: 0;
padding: 10px;
text-decoration: none;
border-bottom: 1px solid rgba(0, 0, 0, 0.25);
text-align: center;
}
#button tab:last-child {
border: none;
}
#button tab:hover {
background-color: #f8f8f8;
color: #404040;
}
#button tab.active {
background-color: #3887be;
color: #ffffff;
}
#button tab.active:hover {
background: #3074a4;
}
提前致谢。
丹尼
【问题讨论】:
标签: html mapbox mapbox-gl-js