【问题标题】:Google Custom Search Engine with IE6带有 IE6 的谷歌自定义搜索引擎
【发布时间】:2010-07-06 16:52:09
【问题描述】:

我正在尝试在我的网站上使用 Google 自定义搜索(商业版)。我没有使用 iFrame,但我使用的是自定义元素。我选择了一个主题,在除 IE6 之外的所有浏览器中一切都很好。所有搜索结果都采用 Promotion CSS。

更新 - 发布代码

<div id="cse-search-form" style="width: 100%;">Loading</div>
<script src="http://www.google.com/jsapi" type="text/javascript"></script>
<script type="text/javascript">
  google.load('search', '1');
  google.setOnLoadCallback(function() {
    var customSearchControl = new google.search.CustomSearchControl('XXXXXXXX');
    customSearchControl.setResultSetSize(google.search.Search.FILTERED_CSE_RESULTSET);
    var options = new google.search.DrawOptions();
    options.setSearchFormRoot('cse-search-form');

    options.setAutoComplete(true);
    customSearchControl.draw('cse', options);
  }, true);
</script>
<link rel="stylesheet" href="http://www.google.com/cse/style/look/minimalist.css" type="text/css" />


<div id="cse" style="width:100%;"></div>

【问题讨论】:

  • 请发布无效的说明、演示链接或屏幕截图。
  • 在 IE6 中,结果看起来都像是促销。我很确定实施没有任何问题,因为如果您使用 IE6 登录 Google CSE 并检查预览,您可以确认我在说什么。这发生在任何主题上,但我正在尝试使用极简主义主题
  • 贴一些代码给我们看看。我们不是魔术师。
  • 嗨...我发布了上面的代码。它是 Google CSE 提供的默认代码,用于在网站上包含 Google 自定义搜索框。您可以在底部看到包含样式表以设置结果和搜索框的样式。 Internet Explorer 6 中的结果看起来好像都是促销活动

标签: css search internet-explorer-6


【解决方案1】:

我已经解决了这个问题。问题在于 Google 提供的 CSS。他们不再支持 IE6 并且事实上没有在任何地方安装浏览器来测试(或者我被告知)。

问题在于 IE6 及其无法支持多个类。查看Ryan Brill's post 了解更多信息。要让 Google 自定义搜索 CSS 与 IE6 一起使用,必须对 CSS 选择器进行一些调整。

例如:div.gs-promotion{ } 而不是 .cse .gs-promotion.gs-result, .gs-promotion.gs-result{ }

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2018-12-13
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2015-03-29
    相关资源
    最近更新 更多