UL li项目赢得';t float:在safari中,正确的选择是什么?

UL li项目赢得';t float:在safari中,正确的选择是什么?,safari,html-lists,Safari,Html Lists,我想做一个有3个李的UL。在chrome/IE/FF中,它工作正常,如下所示: (styles are here) #subnav_right{display:inline;list-style:none;} #subnav_right li{float:right;} <li style="float:right;list-style:none;margin:0px 5px 0 0"> <g:plusone count="false" size="medium">&l

我想做一个有3个李的UL。在chrome/IE/FF中,它工作正常,如下所示:

(styles are here)
#subnav_right{display:inline;list-style:none;}
#subnav_right li{float:right;}

<li style="float:right;list-style:none;margin:0px 5px 0 0">
<g:plusone count="false" size="medium"></g:plusone>
</li>

<li style="float:right;list-style:none;margin:0px 5px 0 0;overflow:hidden;width:50px;">
<div id="fb-root"></div><fb:like href="LIKEBUTTONURL" send="true" layout="button_count" width="50" show_faces="false" send="false" font="arial"></fb:like>
</li>

<li style="float:right;list-style:none;margin:0px 0 0 0">
    <form action="SEARCH BUTTON URL" id="cse-search-box">
        <label for="q">
        <input type="text" name="q" size="19" />
    </form>
</li>

但在safari中,LI's上的浮子不起作用,看起来是这样的:

(styles are here)
#subnav_right{display:inline;list-style:none;}
#subnav_right li{float:right;}

<li style="float:right;list-style:none;margin:0px 5px 0 0">
<g:plusone count="false" size="medium"></g:plusone>
</li>

<li style="float:right;list-style:none;margin:0px 5px 0 0;overflow:hidden;width:50px;">
<div id="fb-root"></div><fb:like href="LIKEBUTTONURL" send="true" layout="button_count" width="50" show_faces="false" send="false" font="arial"></fb:like>
</li>

<li style="float:right;list-style:none;margin:0px 0 0 0">
    <form action="SEARCH BUTTON URL" id="cse-search-box">
        <label for="q">
        <input type="text" name="q" size="19" />
    </form>
</li>

(这里有样式)
#subnav_right{显示:内联;列表样式:无;}
#subnav_right li{float:right;}

  • 这里的故事是什么?为什么这样不行?苹果在这里干什么

    我很惊讶,如果你有更多的浏览器,这不会发生。如果你看一下你的标记,li的出现顺序是1)plusone 2)facebook 3)搜索。当您向右浮动时,元素按该顺序向右浮动,因此plusone是第一个向右浮动的项,并且它们在流中彼此堆叠。您必须重新对其进行排序,以使其按您想要的顺序正确浮动:

    <li style="float:right;list-style:none;margin:0px 0 0 0">
        <form action="SEARCH BUTTON URL" id="cse-search-box">
            <label for="q">
            <input type="text" name="q" size="19" />
        </form>
    </li>
    
    <li style="float:right;list-style:none;margin:0px 5px 0 0;overflow:hidden;width:50px;">
        <div id="fb-root"></div><fb:like href="LIKEBUTTONURL" send="true" layout="button_count" width="50" show_faces="false" send="false" font="arial"></fb:like>
    </li>
    
    <li style="float:right;list-style:none;margin:0px 5px 0 0">
        <g:plusone count="false" size="medium"></g:plusone>
    </li>
    

  • 这样做只会改变它在chrome/FF中的外观,使其与Safari中的外观相同。