Pergunta

I have the following css class which works fine in IE10 with compatibility mode OFF. But when I test this page with Compatibility mode 'ON', the css class is ignored. What this class does is basically set a background color for the table row.

.TMDarkBlue
{
    color: White;
    background: #2895D5;
    font-weight: bold;
}

The HTML for the datagrid where I have used this is as follows.

<asp:DataGrid ID="dgResults" runat="server" AllowPaging="True" GridLines="None" CellSpacing="2" PageSize="15" ForeColor="Black" AllowSorting="True" CellPadding="10" PagerStyle-NextPageText="&gt;">
    <PagerStyle NextPageText="Next" CssClass="pagerStyle" PrevPageText="Prev" HorizontalAlign="Justify" Position="Top" Wrap="False" Mode="NumericPages" ForeColor="#2D4374" Font-Overline="False"></PagerStyle>
    <ItemStyle Wrap="False" CssClass="itemStyle"></ItemStyle>
    <AlternatingItemStyle Wrap="False" CssClass="alternateRow"></AlternatingItemStyle>
    <HeaderStyle CssClass="TMDarkGray" ForeColor="White" />
    <FooterStyle CssClass="TMDarkGray" Wrap="False" />
    <EditItemStyle Wrap="False" />
    <SelectedItemStyle CSSClass="TMOrangeHighlight" Wrap="False" BackColor="#2D4374" />
</asp:DataGrid>

I am new to web frontend developing so please pardon me if I have missed some important info here. Let me know what additional details are needed and I will update this question accordingly.

Thanks

Foi útil?

Solução

Try something like

 table tr.TMDarkBlue td {
         background-color: #2895D5;
          color: white;
          font-weight: bold; 
}
Licenciado em: CC-BY-SA com atribuição
Não afiliado a StackOverflow
scroll top