protected void MasterCust_RowDataBound(object sender, GridViewRowEventArgs e)
{
if (e.Row.RowState == DataControlRowState.Alternate)
{
e.Row.Attributes.Add("onmouseover", "this.style.backgroundColor='#eefef0';");
}
}
我如何将其放入 css 中?
grid.highlight
{
background-color:Blue;
}
是这样的吗?
最佳答案
您可以使用hover
选择器。
grid.highlight:hover
{
background-color:Blue;
}
IE 6、7 和 8 有时会出现 hover
选择器问题,因此,对于这些,您可以使用 Whatever:hover .
关于c# - 如何在 css 中突出显示 "onmouseover"?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/8736720/