嗨我正在尝试为gridview制作一个包含css文件的皮肤
每件事都很好但悬停时的寻呼机号码样式并没有改变字体的颜色 我不知道为什么
皮肤代码:
<asp:GridView runat="server" Width="95%" AutoGenerateColumns="False" SkinId="GridBlue"
CellPadding="4" ForeColor="#333333" HorizontalAlign="Center" Font-Size="10" Font-Names="Arial" BorderWidth="2px" AllowPaging="true" PageSize="5"
AllowSorting="true">
<HeaderStyle Font-Bold="True" ForeColor="#faf6e0" Height="30px" CssClass="gv_hd" />
<FooterStyle Font-Bold="True" ForeColor="#faf6e0" Height="30px" CssClass="gv_ft" />
<RowStyle BackColor="#faf6e0" CssClass="gv_row" Height="30px" />
<AlternatingRowStyle BackColor="#ede0b9" CssClass="gv_row" Height="30px"/>
<PagerSettings Mode="Numeric" />
<PagerStyle Height="35px" CssClass="gv_pgr" VerticalAlign="Middle" HorizontalAlign="Center" />
<EditRowStyle BackColor="#dfc987" VerticalAlign="Middle" HorizontalAlign="Center" CssClass="gv_slct" ForeColor="#5f5f5f" />
<SelectedRowStyle BackColor="#dfc987" VerticalAlign="Middle" HorizontalAlign="Center" font-bold="true" CssClass="gv_slct" ForeColor="#5f5f5f" />
<EmptyDataTemplate>
<center><h1 class="gv_mpty">No Records Found</h1></center>
</EmptyDataTemplate>
</asp:GridView>
css代码:
.gv{text-align:center;}
.gv_hd{height:22px;text-decoration:none;border:#5f5f5f solid 2px;background:-webkit-gradient(linear, left top, left bottom, color-stop(0.05, #548975), color-stop(1, #37705a));background:-moz-linear-gradient(top, #548975 5%, #37705a 100%);background:-webkit-linear-gradient(top, #548975 5%, #37705a 100%);background:-o-linear-gradient(top, #548975 5%, #37705a 100%);background:-ms-linear-gradient(top, #548975 5%, #37705a 100%);background:linear-gradient(to bottom, #548975 5%, #37705a 100%);}
.gv_hd a{text-decoration:none;}
.gv_hd a:hover{text-decoration:underline;}
.gv_hd a:active{text-decoration:underline;}
.gv_ft{padding:10px;text-decoration:none;border:#5f5f5f solid 2px;background:-webkit-gradient(linear, left top, left bottom, color-stop(0.05, #548975), color-stop(1, #37705a));background:-moz-linear-gradient(top, #548975 5%, #37705a 100%);background:-webkit-linear-gradient(top, #548975 5%, #37705a 100%);background:-o-linear-gradient(top, #548975 5%, #37705a 100%);background:-ms-linear-gradient(top, #548975 5%, #37705a 100%);background:linear-gradient(to bottom, #548975 5%, #37705a 100%);}
.gv_row{text-align:center;color:#5f5f5f;padding:}
.gv_row a{text-decoration:none;}
.gv_row a:hover{text-decoration:underline;}
.gv_pgr{color:#5f5f5f;padding:20px;background:-webkit-gradient(linear, left top, left bottom, color-stop(0.05, #faf6e0), color-stop(1, #e7d6a1));background:-moz-linear-gradient(top, #faf6e0 5%, #e7d6a1 100%);background:-webkit-linear-gradient(top, #faf6e0 5%, #e7d6a1 100%);background:-o-linear-gradient(top, #faf6e0 5%, #e7d6a1 100%);background:-ms-linear-gradient(top, #faf6e0 5%, #e7d6a1 100%);background:linear-gradient(to bottom, #faf6e0 5%, #e7d6a1 100%);}
.gv_pgr a{font-weight:bold;margin-top:10px;background-color:transparent;padding:4px 10px;text-decoration:none;border:1px solid #d9c074;}
.gv_pgr a:hover{font-weight:bold;background-color:#548975;border:1px solid #d9c074;color:White;}
.gv_pgr a:active{font-weight:bold;background-color:#548975;color:#faf6e0;border:1px solid #d9c074;}
.gv_pgr span{background-color:#548975;color:#faf6e0;border:1px solid #d9c074;padding:4px 10px;}
.gv_mpty{color:#5f5f5f;}
.gv_slct a{text-decoration:none;text-align:center;}
.gv_slct a:hover{text-decoration:underline;text-align:center;}
在悬停时,寻呼机的字体没有改变
答案 0 :(得分:0)
渲染网格时,可以使用F12来检查CSS,html。确保将行作为要突出显示的类。
答案 1 :(得分:0)
.gv_pgr a:hover{font-weight:bold;background-color:#548975;border:1px solid #d9c074;color:White !Improtant;}
将!important添加到颜色代码