我想将Google翻译按钮中显示的Google徽标变为灰度(即不是亮绿色,红色,蓝色,黄色)。有没有简单的代码(我不是编码器)我可以添加到这个嵌入代码来实现这一点?这是嵌入代码:
<div id="google_translate_element"></div><script type="text/javascript">
function googleTranslateElementInit() {
new google.translate.TranslateElement({pageLanguage: 'en', layout:
google.translate.TranslateElement.InlineLayout.SIMPLE},
'google_translate_element');
}
</script><script type="text/javascript"
src="//translate.google.com/translate_a/element.js?
cb=googleTranslateElementInit"></script>
谢谢。
答案 0 :(得分:1)
你可以在当前的javascript代码块之后添加一些css代码:
<div id="google_translate_element"></div>
<script type="text/javascript">
function googleTranslateElementInit() {
new google.translate.TranslateElement({pageLanguage: 'en', layout: google.translate.TranslateElement.InlineLayout.SIMPLE}, 'google_translate_element');
}
</script>
<script type="text/javascript" src="//translate.google.com/translate_a/element.js?cb=googleTranslateElementInit"></script>
<style media="screen">
#google_translate_element img.goog-te-gadget-icon {
-moz-filter: grayscale(100%);
filter: grayscale(100%);
}
</style>