css3 transition

<!DOCTYPE html><html>
<head>
    <style>
        div {
            width: 100px;
            height: 100px;
            background: blue;
            transition: opacity 2s;
            opacity: 0.1;
        }
        div:hover {
            /* width: 300px; */
            opacity: 1;
        }
    </style>
</head>
<body>
    <div></div>
    <p>请把鼠标指针移动到蓝色的 div 元素上,就能够看到过渡效果。</p>
    <p><b>注释:</b>本例在 Internet Explorer 中无效。</p>
</body>
</html>复制代码
相关文章
相关标签/搜索