【发布时间】:2010-03-16 11:34:22
【问题描述】:
当您在网页上嵌入 Google 地图时,地图中会包含版权文本。
如果嵌入宽度较小的地图,版权文本会延伸到 <div> 之外,而不是在其中的两行中换行。
这是 Google 地图为版权文本插入的 HTML:
<div style="-moz-user-select: none; z-index: 0; position: absolute; right: 3px; bottom: 2px; color: black; font-family: Arial,sans-serif; font-size: 11px; white-space: nowrap; text-align: right;" dir="ltr">
<span></span>
<span>Map data ©2010 LeadDog Consulting, Europa Technologies - </span>
<a href="http://www.google.com/intl/en_ALL/help/terms_maps.html" target="_blank" class="gmnoprint terms-of-use-link" style="color: rgb(119, 119, 204);">Terms of Use</a>
<span></span>
</div>
我尝试使用 jQuery 根据其内容(使用:contains())选择此 HTML 并设置不同的样式,但在 IE 8 中没有应用任何样式。它们在 IE 7 和 Firefox 中应用得很好。
$('.map_placeholder div:contains("Map data ")').css({'white-space': 'normal', 'margin-left': '70px', 'width': '210px', 'border-top': 'solid 10px #c00'});
- 知道 IE 8 是怎么回事吗?
- 您知道达到相同结果的其他方法吗?
【问题讨论】:
-
添加您应用的代码和样式?
标签: javascript jquery css google-maps internet-explorer-8