Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/asp.net/36.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
C# “如何拥有”;onmouseover“;在css中突出显示?_C#_Asp.net_Css - Fatal编程技术网

C# “如何拥有”;onmouseover“;在css中突出显示?

C# “如何拥有”;onmouseover“;在css中突出显示?,c#,asp.net,css,C#,Asp.net,Css,我该如何将其转换为css protected void MasterCust_RowDataBound(object sender, GridViewRowEventArgs e) { if (e.Row.RowState == DataControlRowState.Alternate) { e.Row.Attributes.Add("onmouseover", "this.style.backgroundColor='#

我该如何将其转换为css

    protected void MasterCust_RowDataBound(object sender, GridViewRowEventArgs e)
    {
        if (e.Row.RowState == DataControlRowState.Alternate)
        {
            e.Row.Attributes.Add("onmouseover", "this.style.backgroundColor='#eefef0';");
        }
    }     

类似这样的情况?

假设
网格。突出显示
选择您的元素:

grid.highlight
{
background-color:Blue;
}

否则,您必须修改该选择器。

假设
网格。突出显示
选择您的元素:

grid.highlight
{
background-color:Blue;
}
grid.highlight:hover
{
    background-color: blue;
}

否则,您必须修改该选择器。

您可以使用
悬停
选择器

grid.highlight:hover
{
    background-color: blue;
}

IE 6、7和8有时会在
悬停
选择器上出现问题,因此,对于这些问题,您可以使用。

您可以使用
悬停
选择器

grid.highlight:hover
{
    background-color: blue;
}

IE 6、7和8有时会在
悬停
选择器上出现问题,因此,对于这些问题,您可以使用。

我认为这就是您需要的:

grid.highlight:hover
{
    background-color:Blue;
}

只需添加伪类:将鼠标悬停在

上,我想这就是您要寻找的:

grid.highlight:hover
{
    background-color:Blue;
}

只需在IE6上为鼠标添加伪类
:hover
,只允许在锚点()中使用:hover伪选择器,而不允许在锚点()中使用。好吧,
无论什么:hover
都应该解决该问题,并使其与IE6上的任何元素一起工作。我不认为OP应该考虑主要的替代物(例如JavaScript)来补偿IE6用户。IE6只允许:在锚()中使用悬停伪选择器,而不是你擅长Go.AFAIK,<代码>:不管是:悬停< /代码>应该修复这个问题,并使它与IE6上的任何元素一起工作。我认为OP不应该考虑主要的替代方案(例如JavaScript)来补偿IE6用户。