Click here to Skip to main content
15,881,687 members
Please Sign up or sign in to vote.
3.00/5 (1 vote)
See more:
this code i have used to design my navigation menu strip,

How do i move only logout li item to extreme right,it should be seperated from others

XML
<div id="menu">
    <ul>

        <li><a class="current" href="../home.aspx" accesskey="1" title=""><span>Home</span></a></li>
        <li><a  href="../Entry.aspx" accesskey="2" title=""><span>Entry</span></a></li>
        <li><a  href="../Help.aspx" accesskey="3" title=""><span>Help</span></a></li>
        <li><a href="../contact.aspx" accesskey="4" title=""><span>contact</span></a></li>
        <li><a href="../About.aspx" accesskey="5" title=""><span>About</span></a></li>
        <li><a   href="?id=4" accesskey="6" title=""><span>LogOut</span></a></li>

    </ul>
  </div>



how do i do that?

thanks in advance,
Posted
Comments
Sergey Alexandrovich Kryukov 19-Dec-11 2:54am    
Was that really hard to do? Do you know CSS?
--SA
girish sp 19-Dec-11 3:26am    
i am little low in CSS,

Use CSS, text-align:right style:

This is the simplest possible code sample:

XML
<html>
    <head>
        <style type="text/css"><!--
            li.right { text-align: right; }
        --></style>
    </head>
<body>

<ul>
<li>1</li>
<li>2</li>
<li class="right">3</li>
</ul>

</body>
</html>


—SA
 
Share this answer
 
v2
Comments
girish sp 19-Dec-11 3:21am    
this did not work,the tab still fits there:(
girish sp 19-Dec-11 3:22am    
Might be the prob is because i am placing the list inside the content place holder
Sergey Alexandrovich Kryukov 22-Dec-11 1:57am    
I did exactly what you want and it works. You can always spoil the effect. You can create another sample using this layout feature and something else you need to show what's wrong.
--SA
How about giving your div a specific width and set your logout item right aligned :

XML
<div id="menu" style="width: 300px">
    <ul>

        <li><a class="current" href="../home.aspx" accesskey="1" title=""><span>Home</span></a></li>
        <li><a  href="../Entry.aspx" accesskey="2" title=""><span>Entry</span></a></li>
        <li><a  href="../Help.aspx" accesskey="3" title=""><span>Help</span></a></li>
        <li><a href="../contact.aspx" accesskey="4" title=""><span>contact</span></a></li>
        <li><a href="../About.aspx" accesskey="5" title=""><span>About</span></a></li>
        <li style="text-align: right"><a   href="?id=4" accesskey="6" title=""><span>LogOut</span></a></li>

    </ul>
  </div>



Hope it helps.
 
Share this answer
 
Comments
girish sp 19-Dec-11 3:25am    
if i specify the width it will be boxed in a rectangular shape,it wont be in horizontal fashion

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900