css3.关于translate平移问题(求指导)

2025-05-16 00:06:18
推荐回答(1个)
回答1:

这是你希望的效果吗:


        #div1 {
            background-color: #000000;
            width: auto;
            height: 200px;
            transition: all 2s;
        }
        #div1:hover {
            margin-top: 100px;
        }
        #div2 {
            background-color: red;
            width: 200px;
            height: 200px;
            transition: all 3s;
            float: left;
            margin-left: -500px;
        }
        #div2:hover {
            transform: translate(650%, 0);
        }
        #move:hover {
            transform: translate(90%, 0);
        }
        #move {
            width: 500px;
            height: 200px;
            transition: all 3s;
            background-color: #333333;
            float: left;
        }
        #div3 {
            width: auto;
            height: 200px;
            background-color: green;
            transition: all 3s;
            clear: both;
        }
        #div5:hover {
            transform: translate(0, 100px);
            background-color: yellow;
        }