自定义Google自定义搜索(GCS)文本和样式 [英] Custom Google Custom Search (GCS) Text And Styling

查看:311
本文介绍了自定义Google自定义搜索(GCS)文本和样式的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有Google自定义搜索的付费/商家版本,但我似乎只能自定义搜索的小部分。

I have a paid/business version of the Google Custom Search, but I seems I can only customize small parts of the search.

是否有办法:


  • 包含搜索 不含 ?我不想覆盖大多数样式!important

  • 更改搜索按钮的默认文本和/或添加没有使用自定义CSS

想法是有一个简单的风格输入字段,旁边有一个放大镜,白色背景和一个灰色边界。不幸的是,它看起来像google把很多边距/ padding /其他东西在我不想要的顶部。

Idea is to have a simple styled input field with a magnifying glass next to it, both with white background and a gray border. Unfortunately it looks like google puts lots of margin/padding/other stuff on top which I do not want.

推荐答案

是否正在谈论搜索框而不是搜索结果的样式?

I presume you are talking about styling the search box rather than the search results?

如果是这样,只要您有搜索,就不需要使用他们的搜索框结果页面,而不是一个弹出窗口,它可以处理一个参数(例如www.example.com/searchresults/?q=searchquery)。这是在GCS管理页面中查看和感觉 - >布局 - >结果下设置。点击保存并获取代码,然后将JavaScript代码放在此/ searchresults /页面上。

If so, you don't need to use their search box at all as long as you have a search result page which works off a parameter (e.g. www.example.com/searchresults/?q=searchquery) rather than a pop up. This is set up in GCS admin page under Look and Feel -> Layout -> Results only. Click "Save & Get Code" and then put the JavaScript code on this /searchresults/ page.

然后,您只需要一个标准表单,传递搜索查询。这适用于付费版本和免费版本。

Then you can just have a standard form which directs to that page and passes the search query. This works for both the premium paid version and the free version.

这是我在

This is how I have it set up on www.tunetheweb.com if you want to have a look.

只有缺点是你不能得到他们的汽车如果您将该功能用作其搜索框,则可以在搜索框中填写完整的建议。

Only downside is you can't get their auto complete suggestions in the search box if you use that feature as its no longer their search box.

这篇关于自定义Google自定义搜索(GCS)文本和样式的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆