我正在尝试进行 Google 自定义搜索(我只需要在我的网站上使用某种搜索引擎),并且我需要这样做,以便我可以使用自己的搜索框(输入字段)。我需要它的尺寸准确。我还需要能够制作自己的搜索按钮。我需要能够更改搜索按钮的大小和背景。我还不完全确定,但我实际上可能需要它成为一个常规的 img。
有谁知道该怎么做?
如果你不能通过谷歌做到这一点,你知道另一种方法吗?
如果除了使用您自己的搜索引擎之外没有其他方法,我可以获取一个关于如何制作我自己的非常简化的教程的链接吗?我愿意付出额外的努力来学习,但我尝试了一点,在看了三个不同的图之后,我放弃了,因为它们非常非常长并且令人困惑。我希望我只是找错了地方。
I am trying to make a Google custom search (I just need some sort of search engine on my site), and I need to make it so that I can use my own search box (input field). I need it to be of exact size. I also need to be able to make my own button to search. I am going to need to be able to change the size and background of the search button. I am not completely sure yet, but I might actually need it to be a regular img.
Does anyone know how to do this?
If you cannot do this with Google, do you know of another way to do it?
If there is no other way besides using your own search engine, can I please get a link to a very simplified tutorial on how to make my own. I am willing to put in the extra work to learn, but I tried a bit, and after looking at three different tuts, I gave up because they were very very long and confusing. I hope I was just looking in the wrong places.
发布评论
评论(2)
这是我正在使用的,您只需在搜索框
中添加一些样式,然后
input value='MyButton'< /code> 是点击编辑的按钮
:上面是我2010年的回答,我无法确认它是否有效,但这是一个有效的。
有关详细信息:请参阅 https://developers.google.com/custom -search/docs/js/cselement-devguide
Here is the one I am using, you just need to add some styles to
<input id='q'
which is the search box, and <input value='MyButton'
is the button to clickEdit: Above is my answer from 2010, I cannot confirm it is working or not anymore, but here is the one working.
For more info: refer to https://developers.google.com/custom-search/docs/js/cselement-devguide
适合正在寻找具有“外观和感觉”下的新“叠加结果”选项的解决方案的 Google 员工。我使用了你的答案并添加了一些小技巧以使其发挥作用。基本想法是获取 Google 为您提供的代码,隐藏 Google 的搜索框和按钮,并使用您的答案和正确的 XXXXX:YYYY 代码。隐藏
"
时请勿使用display:none
,否则搜索结果将不起作用。For Googlers who are looking for a solution with new "Overlay Results" option under "Look and Feel" . I used YOU's answer and added some minor hacks to make it work. Basic idea is get the code Google gives you, hide Google's search box and button, and use YOU's answer with the proper XXXXX:YYYY codes. While hiding
<gcse:search></gcse:search>"
do not usedisplay:none
otherwise search results will not work.