Click here to Skip to main content
15,885,546 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi,

How to Highlight the color in a tabs when i select the particular tab. My menu bg color contains css color and it is used in the master page.

Pls. tell me how to hight light the particular tab when i'm clicking...?

see my code
------------
<td class="tdbgcolor"><!--Menu Start-->
                <table width="100%" border="0" align="left" cellpadding="0" cellspacing="0" style="height:15;">
	                    <tr><td>
	                        <div id="ddtopmenubar" class="menu">
                            <ul>
                            <%If Rdr("Home")= "Y" then %><li><a href="Home.aspx">Home</a></li> <%End if %>
                            <%If Rdr("A") = "Y" then %><li><a href="Admin.aspx">Admin</a></li> <%End if %>
                            <%If Rdr("B")="Y" then %><li><a href="B.aspx">B</a></li> <%End if %>
                            <%--<%If Rdr("C") = "Y" then %><li><a href="C.aspx">C</a></li> <% End if %>--%>
                            <%If Rdr("D") = "Y" then %><li><a href="D.aspx">D</a></li> <%End if %>
                            <%If Rdr("E") = "Y" then %><li><a href="E.aspx">E</a></li> <%End If %>
                            </ul>
                            </div>
                         </td>
	                    </tr>
	          <%    End While
	               End If 
	              Rdr.Close 
	              Conn.Close 
	         %>
                  </table>  <!--Menu End-->
              </td>


CSS file
--------
.mattblackmenu ul{
margin: 0;
padding: 0;
font: bold 11px Verdana;
list-style-type: none;
border-bottom: 1px solid gray;
background: #414141;
overflow: hidden;
width: 100%;
}
.mattblackmenu li{
display: inline;
margin: 0;
}
.mattblackmenu li a
{
	float: left;
	display: block;
	text-decoration: none;
	margin: 0;
	padding: 5px 8px; /*padding inside each tab*/
	border-right: 1px solid white; /*right divider between tabs*/
	color: #FFFFFF;
	background: #000000;
	filter:progid:DXImageTransform.Microsoft.Gradient(endColorstr='#75808a', startColorstr='#000000', gradientType='0');   
}
.mattblackmenu li a:visited{
color: white;
}
.mattblackmenu li a:hover{
background: black; /*background of tabs for hover state */
}
.mattblackmenu a.selected{
background: black; /*background of tab with "selected" class assigned to its LI */
}
/*Modal Popup*/
.modalBackground {
 background-color:Gray; 
 -ms-filter: alpha(opacity=70);
 -ms-opacity:0.7;
}
Posted
Updated 1-Aug-11 0:16am
v2

use javascript or jquery.
onclick event change background color
 
Share this answer
 
You can use StaticSelectedStyle property of Menu Control

Menu Control Selected Item Color Change Depending on Selection [^]
Asp - Menu Control[^] & it's example[^]
 
Share this answer
 

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