【发布时间】:2011-09-29 14:25:28
【问题描述】:
我有以下html代码:
<div class="trial1">
He said all but the three newest reactors will be shut down by 2021, and the remainder a year later.Roettgen announced the agreement early on Monday morning after hour-long negotiations between the governing parties.Merkel in 2010 had pushed through to extend the lifespan of the country's 17 reactors with the last one scheduled to go offline in 2036, but she completely reversed her policy in the wake of Japan's nuclear disaster. She described the new move as a step that will make her country a pioneer in renewable energy.
<h1>This is h1</h1>
<div class="trial2">
this is something else what ever what ever
</div>
</div>
我有以下 css:
.trial1
{
position:relative;
}
.trial2
{
display:none;
position:absolute;
z-index:20;
top:1;
left:1;
width:30px;
height:30px;
}
.trial1:hover>.trial2
{
display:block;
}
.trial1:hover>h1
{
color:red;
}
每当试用 1 中的内容悬停时,我都希望显示 trail2 中的内容。但不知何故,这不会发生。在同一元素悬停时更改 h1 颜色的类似过渡是否有效?我做错了什么?
【问题讨论】:
-
既然这是一个“由于错字而解决”的问题,我可以建议将其删除吗?我投了第一个删除票。
标签: html css hover css-selectors