我在我的網站上爲每個div(bg類)設置了標題,但它們僅在徘徊時出現,實際上我希望它們出現在頁面上,然後在懸停時轉換。以下是我的代碼。顯示過渡元素
CSS:
.caption {
color:white;
z-index:100;
position:relative;
word-spacing: 100px;
font-size:12pt;
-webkit-transition: font-size .4s ease-out 1s, word-spacing .4s ease-out 1.5s;
-moz-transition: font-size .4s ease-out 1s, word-spacing .4s ease-out 1.5s;
-o-transition: font-size .4s ease-out 1s, word-spacing .4s ease-out 1.5s;
-ms-transition: font-size .4s ease-out 1s, word-spacing .4s ease-out 1.5s,
transition: font-size .4s ease-out 1s, word-spacing .4s ease-out 1.5s;
}
.bg:hover .caption {
font-size:72px;
word-spacing: 17px;
}
HTML:
<div id='ne' class='bg'>
<div class='overlay'>
<span class='caption'>News</span>
</div>
</div>
=>'color:white;' – AvrilAlejandro 2014-09-21 04:48:16
@avrilalejandro,我不確定你的意思? – czmudzin 2014-09-21 04:50:41
白色文字顏色消失 – AvrilAlejandro 2014-09-21 04:53:28