选择特定标签时如何突出显示标签中的颜色 [英] How to Highlight the color in a tabs when i select the particular tab

查看:59
本文介绍了选择特定标签时如何突出显示标签中的颜色的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述



当我选择特定标签时,如何突出显示标签中的颜色.我的菜单bg颜色包含css颜色,并且在母版页中使用.

请告诉我如何在点击...时突出显示特定标签?

看到我的代码
------------

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文件
--------



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;
}

推荐答案

使用javascript或jquery.
onclick事件更改背景颜色
use javascript or jquery.
onclick event change background color


您可以使用Menu控件的StaticSelectedStyle属性

菜单控件所选项目的颜色根据选择而改变 [ Asp-菜单控件 [它的示例 [
You can use StaticSelectedStyle property of Menu Control

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


这篇关于选择特定标签时如何突出显示标签中的颜色的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆