Google CSE - Hide Refinements for google stored CSE
I have three websites using Google CSE. On two of the sites, I want the search refinements tab to show up. On the third site, I want to hide the refinements tab.
The overall search results appear in an iframe, so I don't know how to effect the css in it.
I believe I am using the "Google Stored CSE" approach to displaying results, which is briefly explained here: http:/开发者_Go百科/www.google.com/cse/docs/cref.html
So how do I hide the refinements on my third site only? I can't target the CSS of the elements in the iframe to do a display:none;
This is possible, but only by abandoning the outdated IFrame display method for your CSE. If you go to the "Look and Feel" tab in your CSE control panel, you can customize the appearance of the CSE controls. You need to use the "Search Element" option, not the "IFrame" option, which, as you will see is deprecated. Once you convert to the new search element, it will load results using javascript directly on to your page, which will allow you to target individual elements with CSS rules or even javascript selection methods just like any other elements on your page; whatever floats your boat at that point.
精彩评论