我只是在IE和Chrome之间存在一些奇怪的布局问题,我可以让它看起来不错,但不是另一个。使用CSS移动下拉菜单栏使其在chrome上看起来很棒,但是在IE中将其中一个条移动到远到页面中间。我不是最好的网络编程/布局,所以我可能会遗漏一些小/简单的东西。附在问题的照片上。
IE-PROD
铬PROD
IE-DEV(变化)
铬DEV(变化)
到目前为止,我所做的唯一改变是Css,他们在这里: (顶部下拉菜单)#searchbar {
margin: 3px 0;
padding: 3px 0;
width: 190px;
clear: left;
}
/*translate element*/
#google_translate_element {
color: transparent;
}
为:
#searchbar {
position:relative;
top: 15px;
right: -10px;
margin: 3px 0;
padding: 3px 0;
width: 190px;
/*clear: left;*/
}
/*translate element*/
#google_translate_element {
position: relative;
left: -310px;
color: transparent;
}
相关的HTML / ascx代码如下(prod / dev之间没有变化)(已删除链接):
<div id="container">
<div class="skin-header">
<!-- Begin Accessibility Links -->
<ul class="accesslinks">
<li><a href="#navigation" accesskey="n">Go to Site Links</a></li>
<li><a href="#maincontent" accesskey="s">Skip to Page Content</a></li>
<li><a href="http://r" accesskey="h">Go to Home Page</a> </li>
<li><a href="mailto:email" accesskey="0">Email Webmaster</a></li>
</ul>
<!-- End Accessibility Links -->
<div class="skin-header_left">
<h2>header</h2>
<h3 class="motto">Building a Better tomorrow</h3>
</div>
<div class="skin-header_right">
<div id="header_icons">
<a href="http://mai" title="check your email"><img
src="/images/ch" alt="staff check email" /></a>
<a href="http://w"
title=" facebook page" rel="external"><img src="/images/facebook1.png"
alt="facebook page" /></a>
<a href="http://tw" title=" twitter" rel="external"><img
src="/images/twitter1.png" alt=" tweets" /></a>
<a href="http://www.youtube.com" title=" on youtube" rel="external">
<img src="/images/youtube1.png" alt=" youtube" /></a>
<a href="http://r" title=" news rss feed"
rel="external"><img src="/images/rss1.png" alt=" rss feed"/></a>
</div>
<div id="searchbar">
<dnn:SEARCH runat="server" id="dnnSEARCH" CssClass="search" UseDropDownList="true" Submit="<img src="images/search.gif" border="0" alt="Search" />" />
</div>
<!-- google tranlation widget code March 23, 2015 -->
<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="//translate.google.com/translate_a/element.js? cb=googleTranslateElementInit"></script>
<!-- google tranlation widget code March 23, 2015 -->
</div>
答案 0 :(得分:0)
结果表明,使用这种语法来放置谷歌翻译器对两者的布局效果都更好,根本不需要进行CSS更改。
<!-- google tranlation widget code March 23, 2015 -->
<div style="display:block;clear:both;"><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="//translate.google.com/translate_a/element.js? cb=googleTranslateElementInit"></script>
</div>
<!-- google tranlation widget code March 23, 2015 -->