unleash
07-18-2011, 06:40 PM
Hello,
I am using the following codes for making a navigation bar!
<div id="top"> -- This ID is basically a navigation bar
<ul class="topnav">
<li class="first">Home</li> ----- This Css Makes my Home as active tab always.
<li> About </li> ---- This is others tabs which I want to make it active when someone click on it not visited but active when someone opens a page!
</ul>
</div>
Please help me to make other tabs active!
Testing Link! (www.t-clicks.com/test)
/* top navigation */
.topnav { z-index:99; margin:0px; padding:1px 0px; list-style:none; line-height:1; }
.topnav a { z-index:100; position:relative; display:block; text-decoration:none; }
.topnav li { float:left; width:auto; }
.topnav li a { padding:7px 13px 6px 13px; font-size:11px; font-weight:bold; color:#1e598e; line-height:18px; text-transform:uppercase; text-decoration:none; }
.topnav li a:hover, .topnav li a:active { background:#ffffff; color:#000000; text-decoration:none; }
.topnav li.first a { background:#FFFFFF; color:#000000; border-top: 2px solid red; }
.topnav .first { background-color: #FFFFFF; color: #FFFFFF; }
.topnav li ul li a, .topnav li ul li a:visited { background:#fff; width:140px; padding:7px 13px 6px 13px; color:#26b; font-size:11px; font-weight:bold; border-bottom:none; text-transform:uppercase; }
/* topnav indicator */
.topnav .sf-sub-indicator { display:none; }
.topnav li ul .sf-sub-indicator { background:url(images/icon-arrow-right.png) no-repeat; position:absolute; display:block; right:0.4em; top:0.9em; width:10px; height:10px; text-indent:-999em; overflow:hidden; }
ul.topnav li{
background:transparent;
}
ul.topnav li a{
border-top:2px solid transparent;
}
ul.topnav li a:hover {
background:white; color:blue;
}
ul.topnav li:nth-child(1) a:hover {
border-top: 2px solid red;
}
ul.topnav li:nth-child(2) a:hover {
border-top: 2px solid blue;
}
ul.topnav li:nth-child(3) a:hover{
border-top: 2px solid green;
}
ul.topnav li:nth-child(4) a:hover{
border-top: 2px solid yellow;
}
I am using the following codes for making a navigation bar!
<div id="top"> -- This ID is basically a navigation bar
<ul class="topnav">
<li class="first">Home</li> ----- This Css Makes my Home as active tab always.
<li> About </li> ---- This is others tabs which I want to make it active when someone click on it not visited but active when someone opens a page!
</ul>
</div>
Please help me to make other tabs active!
Testing Link! (www.t-clicks.com/test)
/* top navigation */
.topnav { z-index:99; margin:0px; padding:1px 0px; list-style:none; line-height:1; }
.topnav a { z-index:100; position:relative; display:block; text-decoration:none; }
.topnav li { float:left; width:auto; }
.topnav li a { padding:7px 13px 6px 13px; font-size:11px; font-weight:bold; color:#1e598e; line-height:18px; text-transform:uppercase; text-decoration:none; }
.topnav li a:hover, .topnav li a:active { background:#ffffff; color:#000000; text-decoration:none; }
.topnav li.first a { background:#FFFFFF; color:#000000; border-top: 2px solid red; }
.topnav .first { background-color: #FFFFFF; color: #FFFFFF; }
.topnav li ul li a, .topnav li ul li a:visited { background:#fff; width:140px; padding:7px 13px 6px 13px; color:#26b; font-size:11px; font-weight:bold; border-bottom:none; text-transform:uppercase; }
/* topnav indicator */
.topnav .sf-sub-indicator { display:none; }
.topnav li ul .sf-sub-indicator { background:url(images/icon-arrow-right.png) no-repeat; position:absolute; display:block; right:0.4em; top:0.9em; width:10px; height:10px; text-indent:-999em; overflow:hidden; }
ul.topnav li{
background:transparent;
}
ul.topnav li a{
border-top:2px solid transparent;
}
ul.topnav li a:hover {
background:white; color:blue;
}
ul.topnav li:nth-child(1) a:hover {
border-top: 2px solid red;
}
ul.topnav li:nth-child(2) a:hover {
border-top: 2px solid blue;
}
ul.topnav li:nth-child(3) a:hover{
border-top: 2px solid green;
}
ul.topnav li:nth-child(4) a:hover{
border-top: 2px solid yellow;
}