嗨,我正在尝试使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;}


在悬停时,传呼机的字体没有变化

最佳答案

渲染网格后,可以使用F12检查CSS,html。确保该行作为您要使突出显示起作用的类。

08-15 19:16