ASP.NET HyperLink和CSS问题

来源:互联网 发布:c语言右移运算 编辑:程序博客网 时间:2024/04/29 12:33

html超链接: 

   a:link{ color :#00688B;text-decoration:none;font-size: small}
   a:hover{ color :#000000;text-decoration:underline}
   a:active{ color :Gray ;text-decoration:underline}
   a:visited{ color :#00688B;text-decoration:none;font-size: small }

aspx超链接: 

在css中设定一个 .X『



第一步   Hyperlink.CssClass= "X "       解析后的代码还是class="X"

第二步  a.X::hover{ color :#000000;text-decoration:underline}

              a.X:visited{ color :#00688B;text-decoration:none;font-size: small }


不用样式表  

this.HyperLink1.Attributes.Add( "onmouseover ", "this.style.color= 'Red ' ");

this.HyperLink1.Attributes.Add( "onmouseout ", "this.style.color= 'blue ' ");

原创粉丝点击