首页
学习
活动
专区
圈层
工具
发布
首页
学习
活动
专区
圈层
工具
MCP广场
社区首页 >问答首页 >渐变颜色未在IE9中显示

渐变颜色未在IE9中显示
EN

Stack Overflow用户
提问于 2015-08-24 10:16:25
回答 1查看 112关注 0票数 0

渐变颜色在ie9中没有显示,但是对其他浏览器很好,我已经为您的reference.please附加了示例代码,并给出了相同的建议。

场景:在devexpress网格行悬停时,将背景色更改为渐变颜色。

CSS

代码语言:javascript
运行
复制
  <style>

  .dxgvDataRow:hover {
   color: #FFFFFF !important;
   background:rgba(108,195,221,0.95) ; 
   background: -moz-linear-gradient(top,  rgba(135,224,253,1) 0%, rgba(108,195,221,0.95) 100%) !important; /* FF3.6+ */
   background: -webkit-gradient(linear, left top, left bottom, color-stop(0%,rgba(135,224,253,1)), color-stop(100%,rgba(108,195,221,0.95))) !important; /* Chrome,Safari4+ */
   background: -webkit-linear-gradient(top,  rgba(135,224,253,1) 0%,rgba(108,195,221,0.95) 100%) !important; /* Chrome10+,Safari5.1+ */
   background: -o-linear-gradient(top,  rgba(135,224,253,1) 0%,rgba(108,195,221,0.95) 100%) !important; /* Opera 11.10+ */
   background: -ms-linear-gradient(top,  rgba(135,224,253,1) 0%,rgba(108,195,221,0.95) 100%) !important; /* IE10+ */
   background: linear-gradient(to bottom,  rgba(135,224,253,1) 0%,rgba(108,195,221,0.95) 100%) !important; /* W3C */
   filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#87e0fd', endColorstr='#f26cc3dd',GradientType=0 ) !important; /* IE6-9 */
    }
    </style>

Aspx页面

代码语言:javascript
运行
复制
   <div class="MainDiv">
     <div class="table-responsive">  
       <dx:ASPxGridView ID="grdProjects" runat="server" KeyFieldName="ProjectId" ClientInstanceName="grdProjects" Width="100%" >
            <Styles Header-HorizontalAlign="Center" Header-VerticalAlign="Middle"
                Header-Font-Bold="true">
            </Styles>
            <Columns>
                <dx:GridViewDataTextColumn Caption="Job #" Width="70px" FieldName="ProjectId" CellStyle-HorizontalAlign="Left" Settings-AutoFilterCondition="Contains" VisibleIndex="1">
                </dx:GridViewDataTextColumn>
                <dx:GridViewDataTextColumn Caption="Tool" FieldName="Tool" CellStyle-HorizontalAlign="Left" Settings-AutoFilterCondition="Contains" VisibleIndex="2">
                </dx:GridViewDataTextColumn>                   

            </Columns>
             <SettingsPager PageSize="5">
                    <PageSizeItemSettings Visible="true" />
                </SettingsPager>

            </dx:ASPxGridView>
          </div>
        </div>

代码语言:javascript
运行
复制
  protected void Page_Load(object sender, EventArgs e)
   {    
        DataSet dsgrdfrmMyjob = new DataSet();
        DataTable dtfrmds = new DataTable();
        dsgrdfrmMyjob.ReadXml(System.Web.Hosting.HostingEnvironment.MapPath("~/ProjectHistory.xml"));

        DataTable dt = new DataTable();

        DataColumn ProjectId = new DataColumn();
        ProjectId.ColumnName = "ProjectId";
        ProjectId.DataType = typeof(int);
        dt.Columns.Add(ProjectId);

        DataColumn Job = new DataColumn();
        Job.ColumnName = "Job";
        Job.DataType = typeof(string);
        dt.Columns.Add(Job);

        DataColumn Tool = new DataColumn();
        Tool.ColumnName = "Tool";
        Tool.DataType = typeof(string);
        dt.Columns.Add(Tool);
        dt.Clear();
        dtfrmds.Clear();
        dtfrmds = dsgrdfrmMyjob.Tables[0];
        foreach (DataRow item in dtfrmds.Rows)
        {
            dt.Rows.Add(item.ItemArray);
        }


        if (dt != null && dt.Rows.Count > 0)
        {
            grdProjects.DataSource = dt;
            grdProjects.DataBind();
        }
        else
        {
            grdProjects.DataSource = null;
            grdProjects.DataBind();
        }
    }
EN

回答 1

Stack Overflow用户

发布于 2015-08-24 10:41:48

CSS梯度在IE9,http://caniuse.com/#feat=css-gradients中不起作用

为了避免这类问题,在CSS梯度背景之前给出坚实的background-color

票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/32179824

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档