LI Menu problem

Discussion in 'CSS' started by le007, May 9, 2012.

  1. #1
    Hi all,

    I have this menu highlighting when the links are hovered. However, I want the last two links (Login and Register) to have a different hover and background colour - can someone tell me how? I've tried a couple of things.

    Thanks

    
    	<ul id="menu1">
    		<li><a href="index.php">Homepage</a></li>
    		<li><a href="buy.php">Buy</a></li>
    		<li><a href="sell.php">Sell</a></li>
    		<li><a href="find.php">Find </a></li>
    		<li><div style="padding-left: 744px;"><a href="login.php">Login</a></div></li>
    		<li><a href="register.php">Register</a></li>
    	</ul>
    
    Code (markup):
     
    le007, May 9, 2012 IP
  2. j_o

    j_o Well-Known Member

    Messages:
    516
    Likes Received:
    2
    Best Answers:
    1
    Trophy Points:
    113
    #2
    j_o, May 9, 2012 IP
  3. le007

    le007 Well-Known Member

    Messages:
    481
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    103
    #3
    I have that but I have a major menu built behind it and just wanted different coloured links on the same menu. It's tricky :/

    Thanks anyway
     
    le007, May 10, 2012 IP
  4. MarkTheUser

    MarkTheUser Member

    Messages:
    206
    Likes Received:
    0
    Best Answers:
    4
    Trophy Points:
    26
    #4
    you can add a class for those 2 li's and then chage them with css.

    
    	<ul id="menu1"> 		<li><a href="index.php">Homepage</a></li> 		<li><a href="buy.php">Buy</a></li> 		<li><a href="sell.php">Sell</a></li> 		<li><a href="find.php">Find </a></li> 		<li class="last2"><div style="padding-left: 744px;"><a href="login.php">Login</a></div></li> 		<li class="last2"><a href="register.php">Register</a></li> 	</ul>
    Code (markup):
    Then just use .last2 in css to change what you want. Be aware that you might have to use !important for it to work since the previous code already sets the same properties as the ones you want to change.
     
    MarkTheUser, May 20, 2012 IP