简体   繁体   English

asp.net中皮肤gridview中的寻呼机样式

[英]pager style in skin gridview in asp.net

hi i am trying to make a skin for gridview contain a css files 嗨,我正在尝试使gridview的皮肤包含一个css文件

every thing work fine but the pager number style on hover didn't change the color of the font i dont know why 一切正常,但悬停时的传呼机号码样式没有更改字体的颜色,我不知道为什么

skin code : 皮肤代码:

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

on hover the font of the pager didn't change 在悬停时,传呼机的字体没有变化

when the grid is rendered, you can use F12 to check the CSS, html. 渲染网格后,可以使用F12检查CSS,html。 Make sure that the row as the class you want to make the highlight work. 确保该行作为您要使突出显示起作用的类。

.gv_pgr a:hover{font-weight:bold;background-color:#548975;border:1px solid #d9c074;color:White !Improtant;}

通过在颜色代码中添加!important

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM