How to make a nav bar with a arrow on top when hovering on it ?

Discussion in 'HTML & Website Design' started by akashbc, Jul 9, 2011.

  1. #1
    I want a nav bar like below which shows an arrow icon above it when mouse hovers on it.


    [​IMG]

    Can anybody help me?


    This is nav bar code that i am currently using:

    #navbar {
    
    
    background-color:black;
    }
    
    
    ul#navigation {	
    	width:1000px;
    	list-style:none;
    	
    margin:0px;
    padding:0px;
    }
    
    ul#navigation li {
    	display:inline
    }
    
    ul#navigation li a {
    
    	height:42px;
    	float:left;
    	text-indent:-9999px;
    	text-decoration:none
    }
    
    ul#navigation  li a span {
    	float:left;
    	display:block
    }
    
    ul#navigation li#navigation-1 a {
    	width:59px;
    	background:url(/templates/27/allnavs.jpg) no-repeat 0px 0
    }
    
    ul#navigation li#navigation-1 a:active,
    ul#navigation li#navigation-1 a:hover {
    	background-position:0px -42px
    }
    ul#navigation li#navigation-1 a.current {
    	background-position:0px -84px
    }
    
    ul#navigation li#navigation-2 a {
    	width:82px;
    	background:url(/templates/27/allnavs.jpg) no-repeat -59px 0
    }
    
    ul#navigation li#navigation-2 a:active,
    ul#navigation li#navigation-2 a:hover {
    	background-position:-59px -42px
    }
    ul#navigation li#navigation-2 a.current {
    	background-position:-59px -84px
    }
    
    ul#navigation li#navigation-3 a {
    	width:72px;
    	background:url(/templates/27/allnavs.jpg) no-repeat -141px 0
    }
    
    ul#navigation li#navigation-3 a:active,
    ul#navigation li#navigation-3 a:hover {
    	background-position:-141px -42px
    }
    ul#navigation li#navigation-3 a.current {
    	background-position:-141px -84px
    }
    
    ul#navigation li#navigation-4 a {
    	width:69px;
    	background:url(/templates/27/allnavs.jpg) no-repeat -213px 0
    }
    
    ul#navigation li#navigation-4 a:active,
    ul#navigation li#navigation-4 a:hover {
    	background-position:-213px -42px
    }
    ul#navigation li#navigation-4 a.current {
    	background-position:-213px -84px
    }
    
    ul#navigation li#navigation-5 a {
    	width:67px;
    	background:url(/templates/27/allnavs.jpg) no-repeat -282px 0
    }
    
    ul#navigation li#navigation-5 a:active,
    ul#navigation li#navigation-5 a:hover {
    	background-position:-282px -42px
    }
    ul#navigation li#navigation-5 a.current {
    	background-position:-282px -84px
    }
    
    ul#navigation li#navigation-6 a {
    	width:92px;
    	background:url(/templates/27/allnavs.jpg) no-repeat -349px 0
    }
    
    ul#navigation li#navigation-6 a:active,
    ul#navigation li#navigation-6 a:hover {
    	background-position:-349px -42px
    
    		 
    	 
    }
    ul#navigation li#navigation-6 a.current {
    	background-position:-349px -84px
    }
    
    ul#navigation li#navigation-7 a {
    	width:559px;
    	background:url(/templates/27/allnavs.jpg) no-repeat -441px 0
    }
    
    ul#navigation li#navigation-7 a:active,
    ul#navigation li#navigation-7 a:hover {
    	background-position:-441px -42px
    
    }
    ul#navigation li#navigation-7 a.current {
    	background-position:-441px -84px
    }
    Code (markup):


    Please say what necessary changes should i have to give?


    Thanks in advance! :)
     
    akashbc, Jul 9, 2011 IP
  2. xira

    xira Active Member

    Messages:
    315
    Likes Received:
    8
    Best Answers:
    4
    Trophy Points:
    68
    #2
    Sorry but I am getting a headache just looking at this code. Why do you have each link coded separately? If you're making your navigation in a list form <ul><li>... </li></ul> and all the menu items function the same, you don't need to single them out. Perhaps part of your problem is that you're targeting each element. From my own experience, when you try to target things in list menus, things get wacked (especially on sub-menus). Try using general code, and testing it on one link first.
     
    xira, Jul 10, 2011 IP
  3. moon_gfx77

    moon_gfx77 Active Member

    Messages:
    57
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    91
    #3
    you need to work with Jquery
     
    moon_gfx77, Jul 12, 2011 IP
  4. akashbc

    akashbc Active Member

    Messages:
    182
    Likes Received:
    4
    Best Answers:
    0
    Trophy Points:
    80
    #4

    I am not actually making the nav bar i shown above..Its just a eg ..I am making another one with sprites that's why the code looks like this and how should i make the arrow appear on each link when mouse hover on it??

    Thank you
     
    akashbc, Jul 12, 2011 IP
  5. akashbc

    akashbc Active Member

    Messages:
    182
    Likes Received:
    4
    Best Answers:
    0
    Trophy Points:
    80
    #5
    Can you please say the code to make this appear?
    I am not well with jquery too :(
     
    akashbc, Jul 12, 2011 IP
  6. uwmilo

    uwmilo Peon

    Messages:
    13
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    0
    #6
    uwmilo, Jul 15, 2011 IP