【问题标题】:Override Google map inline styles with css用 css 覆盖谷歌地图的内联样式
【发布时间】:2013-10-05 08:48:57
【问题描述】:

我正在尝试覆盖新的 Google 地图内联样式,以便使用 CSS 应用我自己的样式。 我不能使用 Jquery,因为它会与 Mootools 冲突(我正在使用 Joomla)。

问题是左上角的“信息窗口”覆盖了地图的很大一部分(加上点气泡),我想限制它一点,因为给定的 280px 宽度太大了。

使用萤火虫我发现这个:

<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;}

我该如何解决这个问题?

PS。我什至试过这个:

body div[class*="b0t70b-haAclf"] {width: 271px !important;}

不走运.. Google Maps Api 是否会阻止我使用 CSS 或什么来触摸它?

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

【问题讨论】:

  • 这是通过 mapsengine 创建的嵌入(在 iframe 中)地图吗?
  • 非常好的问题:)
  • @Dr.Molle 抱歉,我没有收到您回复我的通知!是的,它嵌入在从 gmap 复制的 iframe 中。我用一张图片编辑了这篇文章,以帮助读者理解我的意思。
  • 无法从父页面覆盖这些样式

标签: css google-maps


【解决方案1】:

div#featureListPanel [style] {width: 271px !important;} [style] 不是有效的 css 方式

所以简单地使用这个:

div#featureListPanel {width: 271px !important;}

如果不工作试试这个

body div#featureListPanel [style] {width: 271px !important;}

【讨论】:

  • 嗯,[style] 是一个属性选择器。为什么无效?
猜你喜欢
  • 1970-01-01
  • 2016-12-17
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 2019-09-09
  • 1970-01-01
相关资源
最近更新 更多