为什么 Chrome 忽略了我的 CSS 选择器?

5
在以下网页http://ada.kiexpro.com/test2/map.html中,我添加了:
white-space: normal;

需要将从Google地图API中获取的版权文本进行包装。它在Firefox和IE中有效,但是Chrome似乎忽略了CSS选择器:

global.css:

#cm_map span {
white-space: normal !important;
}
3个回答

3

谷歌在版权内容周围有一个带有内联样式的匿名div。 我能看到的唯一钩子是它是“logocontrol” div的兄弟元素。 要覆盖,请尝试类似以下内容:

#cm_map #logocontrol + div[style] {
    left: auto !important;
    line-height: 13px;
    right: 5px;
    bottom: 6px !important;
    white-space: normal;
    width: 95%;
}

虽然没有进行彻底测试,但是像这样的内容应该可以正常工作。


0

0

这是Chrome忽略important属性的另一个例子。这次是关于位置的。取消“position:relative”的选择确实会把绝对位置带入图片中。因此,样式是有效的。

enter image description here


网页内容由stack overflow 提供, 点击上面的
可以查看英文原文,
原文链接