微信公众号搜"智元新知"关注
微信扫一扫可直接关注哦!

html – Google Foundation中的Google自定义搜索显示问题

我正在尝试添加Google自定义搜索,但它仍然显示不正确.按钮上的搜索图标丢失,看起来好像文本框的底部被切断了.

新成员,所以我无法发布图像.

<div id="header">
  <div class="row">
    <div class="four columns">
      <h1><img src="images/QEFlogo.JPG" /></h1>
    </div>
    <div class="four offset-by-two columns">
      <div id="iso" class="hide-for-small">
        <h1>
          <img src="images/ISO9001.jpg" />
          <img src="images/ISO14001.jpg" />
        </h1>
      </div>
      <div id="gcsearch" class="hide-for-small">
        <gcse:searchBox-only></gcse:searchBox-only>
      </div>
    </div>
  </div>
</div>

没有真正的CSS可以说……

#gcsearch {
    width:300px;
    position:relative;
    left:-5px;
}

该脚本不受Google生成代码的影响.

编辑现在发现这是问题所在. Google元素在其服务器上使用CSS文件default.css.这会生成宽度和高度.

在CSS表的第126行,它定义了……

.cse .gsc-search-button input.gsc-search-button-v2,input.gsc-search-button-v2 {
    height: 13px;
    margin-top: 2px;
    min-width: 13px;
    padding: 6px 27px;
    width: 13px;
}

请记住,我没有太多的Javascript知识,为什么会发生这种情况,我该如何解决

我在非基础页面上测试了代码并且它正确呈现.

解决方法

这是Foundation框架的一个问题.将以下内容添加到按钮并解决.所引用的类是由Google生成的,这就是为什么它们不会显示在我上面的代码中.

input.gsc-search-button,input.gsc-search-button:hover,input.gsc-search-button:focus {
background-image: inherit;
Box-sizing: content-Box;
}

版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。

相关推荐