我正在尝试覆盖新的 Google map 内联样式,以便通过 CSS 应用我自己的样式。 我不能使用 Jquery,因为它会与 Mootools 冲突(我正在使用 Joomla)。
问题是左上角的“信息窗口”覆盖了 map 的大部分(加上点气泡),我想限制它一点,因为给定的 280 像素宽度太大了。
使用 Firebug 我发现了这个:
<div id="featureListPanel" class="b0t70b-haAclf" style="display: block; z-index: 0; position: absolute; left: 0px; top: 144px; width: 280px;"
但我的风格无法超越它:
div#featureListPanel [style] {width: 271px !important;}
我该如何解决这个问题?
附言。我什至试过这个:
body div[class*="b0t70b-haAclf"] {width: 271px !important;}
不走运.. Google Maps Api 会阻止我用 CSS 或什么来触摸它吗?
编辑:有一张图片可以帮助您理解我的意思。被红色包围的是提到的信息窗口。
最佳答案
div#featureListPanel [style] {width: 271px !important;}
[style] 不是有效的 css 方式
所以简单地使用这个:
div#featureListPanel {width: 271px !important;}
如果还是不行试试这个
body div#featureListPanel [style] {width: 271px !important;}
关于css - 用 css 覆盖谷歌地图内联样式,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/19078143/