1
我有以下懸停效果,現在我該如何淡入淡出?CSS3淡入之前/之後的內容
HTML
<article>
hello world
</article>
CSS
article
{
position: relative;
float: left;
margin: 0 16px 16px 0;
padding: 10px;
width: 228px;
height: 228px;
-webkit-box-sizing: border-box;
-moz-box-sizing: border-box;
box-sizing: border-box;
overflow: hidden;
background: green;
}
article:hover:after
{
content: '';
position: absolute;
top: 0;
left: 0;
width: 322px;
height: 322px;
background: #fff;
-webkit-transform: translate(-161px, -161px) rotate(135deg);
-moz-transform: translate(-161px, -161px) rotate(135deg);
transform: matrix(-161px, -161px) rotate(135deg);
opacity: 0.5;
-webkit-transition: opacity 1s ease-in-out;
-moz-transition: opacity 1s ease-in-out;
transition: opacity 1s ease-in-out;
}
啊!我現在明白了。我實際上並不想讓方塊旋轉(它的意思是隻顯示爲一個三角形),但懸停現在完美。謝謝:)(我不能接受作爲一個答案!8分鐘和數......) – Chris