我有以下 HTML:
<div id="player">
<div class="frame" data-aspect="4:3">
</div>
<div class="seeker">
</div>
<div class="controls">
</div>
<div class="extra-controls">
</div>
</div>
我试图使用.seeker
以下选择器进行访问:
#player .frame + #player .seeker
{
margin-top: 1em;
height: 50px;
background-color: #575757;
color: white;
}
哪个没有样式.seeker
元素(链接到第 1 号小提琴),没有#player
它的地方(链接到第 2 号小提琴):
#player .frame + .seeker
{
margin-top: 1em;
height: 50px;
background-color: #575757;
color: white;
}
我很困惑,因为直接选择,没有+
它选择元素(链接到第 3 号小提琴),所以,有一个匹配的#player .seeker
.
注意:每个小提琴都有几乎相同的结果,但是它们的 CSS 有点不同。
这里发生了什么?