我正在使用谷歌翻译API,我想显示国家名称和国旗, 我已经尝试使用css在选项中添加标记,但它没有woking。我的代码是:
<div id="google_translate_element"></div>
<script type="text/javascript">
function googleTranslateElementInit() {
new google.translate.TranslateElement({pageLanguage: 'en', includedLanguages: 'ar,de,en,es,fr,it,ja,ko,nl,pt,ru,tr,zh-CN,zh-TW', multilanguagePage: true, gaTrack: true, gaId: 'UA-64233213-1'}, 'google_translate_element');
}
</script>
<script type="text/javascript" src="//translate.google.com/translate_a/element.js?cb=googleTranslateElementInit"></script>
CSS:
select.goog-te-combo option{
background-repeat:no-repeat;
background-position:bottom left;
padding-left:30px;
width:20px;
height:20px;
display:inline-block;}
select.goog-te-combo option[value="en"]{
background-color:transparent;
background-image:url(images/flags/english.png);}
如何在下拉菜单中显示带国家/地区名称的标记。