我願意爲包含Google Maps元素的標記添加一些嵌入陰影框。但是,似乎沒有任何反應,可能是因爲Google在原始元素中加載了一些其他div,因此覆蓋了生成的box-shadow。在Google地圖元素上添加嵌入框陰影
我該如何達到這個效果?
這裏是我的代碼:
<section id="map-container">
<figure id="map"></figure>
</section>
#map-container {
position: relative;
float: right;
width: 700px;
background-color: #F9FAFC;
border-top-right-radius: 5px;
border-bottom-right-radius: 5px;
}
#map {
position: relative;
height: 400px;
border-top-right-radius: 5px;
border-bottom-right-radius: 5px;
box-shadow: 0 1px 0 0 #F6F7FB inset, 0 -1px 0 0 #E0E5E1 inset, 0 -2px 0 0 #EBEBED inset, 0 -3px 0 0 #F4F4F6 inset;
}
謝謝!
在您的示例中,您是否仍然可以拖動地圖並單擊縮放按鈕?當我複製代碼時,陰影確實有效,但鼠標事件不會。 – Ole
不,當然不會爲他工作。這是唯一現存的解決方案。狗屎是鼠標事件不起作用!但是,谷歌應該真的提供一種方法來實現這種效果。 –