gpt4 book ai didi

javascript - 如何从特定语言的下拉列表中删除 "powered by google translate"并通过谷歌翻译器翻译网页

转载 作者:行者123 更新时间:2023-12-04 08:13:38 27 4
gpt4 key购买 nike

我要删除 “由谷歌翻译提供支持”在下拉列表的标题和底部
enter image description here
我只需要特定语言下拉菜单
enter image description here
代码

<!DOCTYPE html>
<html lang="en-US">
<body>

<h1>My Web Page</h1>
<p>Hello everybody!</p>
<p>Translate this page:</p>

<div id="google_translate_element"></div>

<script type="text/javascript">
function googleTranslateElementInit() {
new google.translate.TranslateElement({ pageLanguage: 'en' }, 'google_translate_element');
}
</script>

<script type="text/javascript" src="https://translate.google.com/translate_a/element.js?cb=googleTranslateElementInit"></script>

<p>You can translate the content of this page by selecting a language in the select box.</p>

</body>
</html>

最佳答案

您可以在 CSS 中添加这些代码行文件:

body {
top: 0px !important;
}

.goog-logo-link {
display:none !important;
}

.goog-te-gadget {
color: transparent !important;
}

.goog-te-banner-frame.skiptranslate {
display: none !important;
}

关于javascript - 如何从特定语言的下拉列表中删除 "powered by google translate"并通过谷歌翻译器翻译网页,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/65821089/

27 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com