How to change the google custom search watermark

孤者浪人 提交于 2020-01-14 10:16:25

问题


I have google custom search, by default the search box has got background image, I can remove that image, But not able to replace with my image. so Is there a way to do this.


回答1:


Adding this to my CSS worked for me:

.cse input.gsc-input, input.gsc-input {background-image:none !important;}



回答2:


Yes! You can do this!

Please find particular id or css for that and then use CSS according to that id or CSS and make sure you add !important at end it will works for you.




回答3:


To remove the Google Custom search watermark you need to run a java-query infinite looped code it can't be done by adding a one time running code since every time you will click the search input field he code will rerun from the server side and the watermark will reappear.

the exact code you need to do is listed below but to achieve the desired result you must import Jquery liberary file from link jquery.com download/ and link it to your page

to link it to your page do so.

<script src="//code.jquery.com/jquery-1.11.0.min.js"></script>

the actual code to hide watermark is.

<script>
    $(document).ready(function() {
        setInterval( function() 
        {
            $("#gsc-i-id1").css("background-image","none")
        },1/*Time*/);
    });
</script>

because the ID of the search box is " gsc-i-id1 " so the code will work even if you click and unclick the field.

Please adjust the time of the function to your preference for better performance better keep it less than 100 mile seconds

check the live performance of code by clicking the link below. http://jsfiddle.net/atulc007/tHQAD/1/




回答4:


You have to customize GCSE which is given in your code. To explain in detail, you have to select this url in your code - "http://www.google.com/coop/cse/brand?form=cse-search-box&lang=en". Then paste and search this url in your browser. You will get the sorce code of that java script. In that find an image .gif link and replace with your image and save it as .js file and replace the link and upload. Hope you will enjoy :)



来源:https://stackoverflow.com/questions/8132103/how-to-change-the-google-custom-search-watermark

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!