为什么没有改变标题和行格的前景?

时间:2014-12-29 07:04:54

标签: css asp.net

    <asp:GridView ID="GridView1" runat="server" 
        Width="847px" CellPadding="4" ForeColor="Black" GridLines="None" 
        AutoGenerateDeleteButton="True" onrowdeleting="Gridview1_rowDeleted" HeaderStyle-ForeColor="Black">
        <AlternatingRowStyle BackColor="White" />
        <FooterStyle BackColor="orange" Font-Bold="True" ForeColor="Black" />
        <HeaderStyle BackColor="orange" Font-Bold="True" ForeColor="#000000" />
        <PagerStyle BackColor="#FFCC66" ForeColor="Black" HorizontalAlign="Center" />
        <RowStyle BackColor="#FFFBD6" ForeColor="Black" />
        <SelectedRowStyle BackColor="#FFCC66" Font-Bold="True" ForeColor="Navy" />
        <SortedAscendingCellStyle BackColor="#FDF5AC" />
        <SortedAscendingHeaderStyle BackColor="#4D0000" />
        <SortedDescendingCellStyle BackColor="#FCF6C0" />
        <SortedDescendingHeaderStyle BackColor="#820000" />
    </asp:GridView>

此gridview的结果是标题字体显示为橙色,但我将其更改为黑色。此外,从我添加网格视图的点开始,所有网格视图的行和标题的字体颜色都是橙色。为什么我不能改变我的愿望?

css部分是: -

    html,body,div,span,applet,object,iframe,h1,h2,h3,h4,h5,h6,p,blockquote,pre,a,abbr,acronym,address,big,cite,code,del,dfn,em,img,ins,kbd,q,s,samp,small,strike,strong,sub,sup,tt,var,b,u,i,dl,dt,dd,ol,nav ul,nav li,fieldset,form,label,legend,table,caption,tbody,tfoot,thead,tr,th,td,article,aside,canvas,details,embed,figure,figcaption,footer,header,hgroup,menu,nav,output,ruby,section,summary,time,mark,audio,video{border-style: none;
border-color: inherit;
border-width: 0;
margin: 0;
padding: 0;
font-size:small;
vertical-align:baseline;
color: #FF9933;

}

2 个答案:

答案 0 :(得分:0)

从您的CSS部分删除table,th,tr,thead,tbody,td

答案 1 :(得分:0)

你可以编写css类并设置cssClass属性