flower
flower

Reputation: 2242

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

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>

Upvotes: 0

Views: 22

Answers (1)

Bogdan Kuštan
Bogdan Kuštan

Reputation: 5577

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)

Upvotes: 1

Related Questions