渐变颜色在ie9中没有显示,但是对其他浏览器很好,我已经为您的reference.please附加了示例代码,并给出了相同的建议。
场景:在devexpress网格行悬停时,将背景色更改为渐变颜色。
CSS
<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页面
<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>码
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();
}
}发布于 2015-08-24 10:41:48
CSS梯度在IE9,http://caniuse.com/#feat=css-gradients中不起作用
为了避免这类问题,在CSS梯度背景之前给出坚实的background-color。
https://stackoverflow.com/questions/32179824
复制相似问题