首先抱歉我的英语不好:
我有这个CSS
span.favoritos {position:absolute;left:550px;visibility:hidden;}
span.favtitle {position:absolute;top:-20px;left:450px;visibility:hidden;background: rgba(81,81,81, .9);color:#f2f2f2;padding:2px 4px 2px 4px;width:115px;-webkit-border-radius:4px;-moz-border-radius:4px;border-radius:4px;}
.favoritos a {display:block;
width:24px;
height:24px;
text-indent:-9999px;
background:url(img/sprite2.png) -21px -324px no-repeat;
-webkit-border-radius:4px;-moz-border-radius:4px;border-radius:4px}
.favoritos a:hover {
background:url(img/sprite2.png) -21px -283px no-repeat;}
.favsave a {display:block;
width:24px;
height:24px;
text-indent:-9999px;
background:url(img/sprites.png) -121px -108px no-repeat;
border:1px #ececec solid;
-webkit-border-radius:4px;-moz-border-radius:4px;border-radius:4px;}
.content:hover span.favoritos {visibility:visible;}
.content:hover span.favdel {visibility:visible;}
.favoritos:hover span.favtitle {visibility:visible;}
这个HTML
<div class="content">
<span class="favtitle">Añadir a favoritos</span>
<span class="favoritos"><a title="Guardar en favoritos" href="#oferta-guardada">favoritos</a></span>
</div>
但是,如果我将鼠标悬停在<span class="favoritos"></span>
上无效,则表示<span class="favtitle">
我不知道为什么。
有人可以帮助我吗?
答案 0 :(得分:0)
span.favtitle
不是.favoritos:hover
的后代,因为您试图在最后一个选择器中解决它。