Search code examples
cssgoogle-chromelayoutinternet-explorer-10ascx

chrome and IE layout Differences issue


I am just having some weird layout issues between IE and Chrome, I can get it to look decent on one, but not the other. moving the drop-down menu bars with CSS gets it to look great on chrome, but moves one of the bars way to far to the middle of the page in IE. I am not the best at web programming/layouts, so I may be missing something small/simple. attached at pictures of the issue.

IE-PROD IE-Prod

Chrome-PRODChrome-Prod

IE-DEV(changes)IE-dev(changes)

Chrome-DEV(changes)chrome-dev(changes)

the only changes i have made so far are to the Css and here they are: ( top dropdown menu)

#searchbar {
    margin: 3px 0;
    padding: 3px 0;
    width: 190px;
    clear: left;
}

/*translate element*/
#google_translate_element {
  color: transparent;
}

to:

 #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;
}

the related HTML/ascx code is as follows (no changes between prod/dev)(links removed):

<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=&quot;images/search.gif&quot;     border=&quot;0&quot; alt=&quot;Search&quot; /&gt;" />
</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>

Solution

  • turns out that using this syntax for placing the google translator works much better for the layout in both, no CSS changes were needed at all.

     <!-- 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 -->