开发者

ul li List Style Navigation with some items right aligned

I have a case where I have a ul li menu that I would like some of the elements to be aligned to the right.

I can't put a defined size because the menu changes and sometimes there are more or less nav elements. Also sometimes there may be more then one item I want aligned right.

ul li List Style Navigation with some items right aligned

Here is a jsfiddle I started to demonstrate what I am trying to do in code.

http://jsfiddle.net/bjPAt/

<ul>
    <li><a href="#">Nav 1</a></li>
    <li><a href="#">Nav 2</a></li>
    <li><a href="#" class="right_nav">Right Nav</a></li>
<开发者_开发技巧;/ul>

** This may not be possible and I will have to change the html around.


You need to float:right the <li> tag not the <a> tag. See modified version here:

http://jsfiddle.net/bjPAt/4/


Here ya go:

http://jsfiddle.net/bjPAt/5/

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜