Warning: file_get_contents(/data/phpspider/zhask/data//catemap/7/css/35.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
CSS:调用悬停时其他对象的悬停_Css_Xml_Hover - Fatal编程技术网

CSS:调用悬停时其他对象的悬停

CSS:调用悬停时其他对象的悬停,css,xml,hover,Css,Xml,Hover,我目前正在从事一个xml+css项目。我有一个类为:player class=center id=z01 menID=m\u John\u Smith> 我正在寻找一种方法,每当我使用hover of John_Smith对象时,对id为m_John_Smith的所有玩家调用hover 有什么想法吗?使用CSS最好的方法是 [menID="m_John_Smith"]:hover ~ [menID="m_John_Smith"] { /*put the same hover style

我目前正在从事一个xml+css项目。我有一个类为:player class=center id=z01 menID=m\u John\u Smith>

我正在寻找一种方法,每当我使用hover of John_Smith对象时,对id为m_John_Smith的所有玩家调用hover


有什么想法吗?

使用CSS最好的方法是

[menID="m_John_Smith"]:hover ~ [menID="m_John_Smith"] {
    /*put the same hover style here*/
}
但这只会高亮显示悬停元素后具有相同menID的所有同级

因此,我很抱歉地告诉您,仅CSS无法实现此目的,您将需要使用其他功能。

在id为m_John_Smith的所有玩家上调用鼠标悬停。首先,不要在一个页面上使用重复的id。第二,约翰·史密斯和m·约翰·史密斯之间是否存在DOM关系?