css - 用 css 覆盖谷歌地图内联样式

标签 css google-maps

我正在尝试覆盖新的 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 或什么来触摸它吗?

编辑:有一张图片可以帮助您理解我的意思。被红色包围的是提到的信息窗口。 Annoing Google Infowindow

最佳答案

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/

相关文章:

html - 如何在导航栏中居中品牌/形象

html - 如何将按钮添加到我的页面(在 HTML 上布置按钮)

javascript - 未捕获 Google Map InfoWindow 中的点击事件

javascript - Vanilla JS 中 CSS 样式属性的数学运算

css - 溢出问题 :auto

google-maps - 围绕一个点绘制多边形 x 米

android - 每当我从一个选项卡切换到另一个选项卡时,都会再次调用 onCreate 方法

javascript - php - 使用 mpdf 工具从 googlemap 内容创建 pdf

html - 在信息框中使用 closeclick 事件

html - 跨浏览器兼容性需要多少外部样式表?