css3新选择器目标处于悬停状态
在css3中有没有一种方法可以将一个div作为悬停的目标,所以如果我有一个如下的结构,我可以将div作为h1的直接同级来作为目标css3新选择器目标处于悬停状态,css,css-selectors,target,Css,Css Selectors,Target,在css3中有没有一种方法可以将一个div作为悬停的目标,所以如果我有一个如下的结构,我可以将div作为h1的直接同级来作为目标 <h1>item1</h1> <div>this is the description for 1</div> <h1>item2</h1> <div>this is the description for 2</div> <h1>item3</h1&
<h1>item1</h1>
<div>this is the description for 1</div>
<h1>item2</h1>
<div>this is the description for 2</div>
<h1>item3</h1>
<div>this is the description for 3</div>
item1
这是1的描述
项目2
这是2的描述
项目3
这是对3的描述
您可以使用:
h1 + div:hover { ... }
演示:
W3C是您的朋友(至少在大多数情况下):