wyc
wyc

Reputation: 55263

Why is Chrome ignoring my CSS selector?

In the following page http://ada.kiexpro.com/test2/map.html I added:

white-space: normal;

to wrap the copyright text that is coming our from the Google map API. It works in FF and IE but Chrome seems to ignore the CSS selector:

global.css:

#cm_map span {
white-space: normal !important;
}

Upvotes: 5

Views: 4396

Answers (3)

Michael Parisi
Michael Parisi

Reputation: 130

Here is another example of chrome ignoring the important. This time its on the position. Unclicking the "position: relative" does bring the absolute into the picture. So the style is valid.

enter image description here

Upvotes: 0

Dan Dascalescu
Dan Dascalescu

Reputation: 151926

This may also be a bug in Chrome: white-space normal !important doesn't override nowrap.

enter image description here

I've reported this bug at http://code.google.com/p/chromium/issues/detail?id=89573, but based on how they have been completely ignoring a more important issue since 2009, I have little hope of this being fixed.

Upvotes: 0

Andrew
Andrew

Reputation: 1187

Google has an anonymous div with inline styles surrounding the copyright content. Only hook I can see is that it's a sibling of the "logocontrol" div. To override, try something like the following:

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

Not thoroughly tested but something like this should work.

Upvotes: 3

Related Questions