相关html:
<div class="bottom-page">
<p>What is <span class="carmeet">CarMeet?</span></p>
</div>
<div class="definitions">
<span class="n1"><p><span class="carmeet1">CarMeet</span> is the number
one website for fans of cars, and car enthusiasts alike.</p></span>
<span class="n2"><p><span class="style2">Find</span> riders in your
local area, state, region, or country. <span class="style2">Cruise</span>
along.</p>
<span class="n3"><p><span class="style2">Create</span> and <span
class="style2">Join</span> crews to drift along with. Stay up-to-date with
your group <span class="style2">Online</span> or on <span
class="style2">Adventures</span>.</p></span>
<span class="n4"><p>Actively<span class="style2"> engage</span> in the
community through the online <span class="style2">forum</span>.</p></span>
<span class="n5"><p><span class="style2">Coast</span> through countless
<span class="style2">news articles</span> to find out what else is
happening in
the <span class="style2">world of automobiles</span>, and find what's
available
on the <span class="style2">market</span>.</p></span>
</div>
</div>
相关CSS;
.n1:hover {
outline-style: solid;
background-color: lightgreen;
opacity: 0.8;
color: black;
}
.n2:hover {
outline-style: solid;
background-color: lightblue;
opacity: 0.8;
color: black;
}
.n3:hover {
outline-style: solid;
background-color: lightcoral;
opacity: 0.8;
color: black;
}
.n4:hover {
outline-style: solid;
background-color: lightyellow;
opacity: 0.8;
color: black;
}
.n5:hover {
outline-style: solid;
background-color: #9558a0;
opacity: 0.8;
color: black;
}
我敢肯定,关于同一件事还有其他一百个问题,但是我似乎找不到能帮助我解决这个问题的问题。 当我将鼠标悬停在n3-n5上时,它将触发n2。悬停n1时不会发生这种情况。 非常感谢,也很抱歉成为菜鸟。
答案 0 :(得分:0)
n5
,n4
和n3
在其子级中都使用类style2
。
为每个子跨度创建不同的类以具有单独的悬停效果。
答案 1 :(得分:-1)
不关闭<span class="n2">
上的span标签
<span class="n2"><p><span class="style2">Find</span> riders in your
local area, state, region, or country. <span class="style2">Cruise</span>
along.</p></span>
答案 2 :(得分:-1)
您错过了第二个收盘时间:
我已完成更改,请检查跨度display:block;
<div class="bottom-page">
<p>What is <span class="carmeet">CarMeet?</span></p>
</div>
<div class="definitions">
<span class="n1"><p><span class="carmeet1">CarMeet</span> is the number
one website for fans of cars, and car enthusiasts alike.</p></span>
<span class="n2"><p><span class="style2">Find</span> riders in your
local area, state, region, or country. <span class="style2">Cruise</span>
along.</p></span>
<span class="n3"><p><span class="style2">Create</span> and <span
class="style2">Join</span> crews to drift along with. Stay up-to-date with
your group <span class="style2">Online</span> or on <span
class="style2">Adventures</span>.</p></span>
<span class="n4"><p>Actively<span class="style2"> engage</span> in the
community through the online <span class="style2">forum</span>.</p></span>
<span class="n5"><p><span class="style2">Coast</span> through countless
<span class="style2">news articles</span> to find out what else is
happening in
the <span class="style2">world of automobiles</span>, and find what's
available
on the <span class="style2">market</span>.</p></span>
</div>
</div>
.definitions > span {
display: block;
}
.n1:hover {
outline-style: solid;
background-color: lightgreen;
opacity: 0.8;
color: black;
}
.n2:hover {
outline-style: solid;
background-color: lightblue;
opacity: 0.8;
color: black;
}
.n3:hover {
outline-style: solid;
background-color: lightcoral;
opacity: 0.8;
color: black;
}
.n4:hover {
outline-style: solid;
background-color: lightyellow;
opacity: 0.8;
color: black;
}
.n5:hover {
outline-style: solid;
background-color: #9558a0;
opacity: 0.8;
color: black;
}