I have created a navigation bar that you can check its codes in https://jsfiddle.net/atgdLafa/
and have 2 questions:
1- Why the id name of <div>
container and <ul>
must be the same?If i change the id name of main container then arrangement of list change.
2-How can i change the gap between the lists(suppose 'home' and 'music')
#navcontainer{
height: 35px;
width: 1000px;
background-color: #ffffff;
padding-right: 0px;
margin-top: 0px;
margin-right: auto;
margin-left: auto;
margin-bottom: 0px;
border:1px solid #f2f2f2;
}
/*styling navigation bar*/
#navcontainer ul {
height: 35px;
background: #ffffff;
list-style : none;
float: right;
width:990px;
background-color:#ffffff;
font-family: Tahoma;
margin: auto 0;
padding-right:0px;
}
#navcontainer ul li {
display: inline-block;
border-top-left-radius: 5px;
border-top-right-radius: 5px;
overflow:hidden;
}
#navcontainer ul li a {
text-decoration:none;
float:right;
text-align:center;
line-height:35px;
font:Tahoma;
}
#navcontainer ul li a:hover {
color:#ffffff;
}
li.home a {color: #ffffff;background-color: #0a0a5c; font-weight:bold; font: Tahoma ; font-size: 12px; height:35px; width:80px; }
li.musicarchive a {color:#ffffff; background-color: #0a0a5c; font-weight:bold; font-size: 12px; height:35px; width:120px; }
li.health a {color:#ffffff; background-color: #0a0a5c; font-weight:bold; font-size: 12px; height:35px; width:90px;}
li.artandculture a {color:#ffffff; background-color: #0a0a5c; font-weight:bold; font-size: 12px; height:35px;width:120px;}
li.tech a {color: #ffffff; background-color: #0a0a5c ; font-weight:bold; font-size: 12px; height:35px; width:110px;}
li.home a:hover {background: #bb0700;}
li.musicarchive a:hover {background: #dd423b ;}
li.health a:hover {background: #B3DE83;}
li.artandculture a:hover {background: #dd423b;}
li.tech a:hover {background:#646373 ;}
<div id="navcontainer">
<ul id="navcontainer" dir="rtl" >
<li class="home"><a href="./index.php" >home</a></li>
<li class="musicarchive"><a href="music/index.php" >music</a></li>
<li class="health"><a href="health/health.php">health</a></li>
<li class="artandculture"><a href="./artandculture/artandculture.php">art</a></li>
<li class="tech"><a href="./tech/tech.php">tech</a></li>
</ul>
</div><!-- end of nav -->