我剛剛學習CSS3和HTML5,現在我試圖讓我的跨文本過渡到另一種顏色,當鼠標懸停在.link div與下面的代碼。出於某種原因,它不工作,我已經嘗試了幾件事情,以使其工作,但迄今沒有運氣。跨度文本不改變懸停
任何人都可以幫助我解決問題或指向正確的方向嗎?
謝謝!
-
HTML
<div id="celebrity-list">
<header>
<h2>Celebrities</h2>
</header>
<div id="a">
<span class="letter">A.</span>
<div class="links">
</div>
</div>
</div>
CSS
#celebrity-list > div span.letter{
position: relative;
font: 22px Arial;
color: #3a3a3a;
-webkit-transition: color .3s ease-out;
-moz-transition: color .3s ease-out;
-o-transition: color .3s ease-out;
-ms-transition: color .3s ease-out;
transition: color .3s ease-out;
}
#celebrity-list > div .links:hover #celebrity-list > div span.letter{
color: #b43838;
}
#celebrity-list > div .links{
position: relative;
width: 190px;
height: 342px;
background: #f2f2f2;
-webkit-transition: border .3s ease-out;
-moz-transition: border .3s ease-out;
-o-transition: border .3s ease-out;
-ms-transition: border .3s ease-out;
transition: border .3s ease-out;
}
如果你**實際**添加一些':hover'風格,它可能會有所幫助。 – iConnor