How to avoid wrap in IE7 when I have two ul in a navigation?

23 views Asked by At

In ie8 or firefox browser,My code runs well,the two ul are in the same line.But when I ie7,the two ul are in the diffrent line,How to make then in the same line in ie7?

<DIV id='navigation'>
<ul><li><span> leftspan </span></li></ul>
<ul style='float:right;'>
   <li><span> leftspan </span></li>
    <li><a href="http://www.google.com"
        target="_blank">google</a></li>
    <li><a href="http://www.apple.com"
        target="_blank">apple</a></li>
 </ul></DIV>
1

There are 1 answers

0
Bogdan Kuštan On BEST ANSWER

When using floats, floating elements should come first in DOM tree.

<div id='navigation'>
<ul style='float:right;'>
   <li><span> leftspan </span></li>
   <li><a href="http://www.google.com"
        target="_blank">google</a></li>
   <li><a href="http://www.apple.com"
        target="_blank">apple</a></li>
 </ul>
 <ul>
   <li><span> leftspan </span></li>
 </ul>
</div>

This should work in IE7 (It works on emulator)