0

繰り返しになりますが、リストは私の頭を悩ませています。

<div id="headbottom">
            <ul id="headnavbutton">
                <li id="button1" class="headnavbutton"></li>
                <li id="button2" class="headnavbutton"></li>
            </ul>   
 </div>

CSS:

#headbottom{position:relative;width:960px;height:29px;margin:auto;bottom:10px;}
#headnavbutton{float:right;height:100%;width:250px;padding:0;}
.headnavbutton{float:right;border: 1px solid #ccc;padding-top:0px;list-style:none;}
#button1 {width:100px;height:100%;background:url(../images/headnavbutton.gif);}
#button2 {width:100px;height:100%;background:url(../images/headnavbutton.gif);}

とても甘くてシンプルに見えます、あなたは言うかもしれません。しかし、何らかの理由で私には知られていないので、リストは親divからプッシュダウンされます。

これがJSfiddleです。正確ではありませんが、何が起こっているかを表すのに適しています。

http://jsfiddle.net/WXbbj/5/

4

1 に答える 1

1

次に、 divheadnavbuttonのマージンを次のように定義します

#headnavbutton {
    margin: 0;
}
于 2012-06-19T11:52:22.560 に答える