前端基础类学习

css3常用相关属性

2017-11-29  本文已影响14人  饥人谷_米弥轮
表单特性与函数
<body>
    <form action="https://s.taobao.com/search">
        <input type="password" placeholder="请输入密码" />
        <input type="text" name="user" autocomplete="off">
        <input type="text" name="user" autofocus="">
        <input type="text" name="user" required="">

        <input type="text" list="miaov" />
        <datalist id="miaov">
            <option value="javascript">javascript</option>
            <option value="html">html</option>
            <option value="css">css</option>
        </datalist>

        <input type="submit" />
        <input type="submit" value="保存" formaction="http://www.baidu.com" />
    </form>
</body>
-webkit-filter 滤镜
transform 将元素进行2D或3D转换
<style>
    div {
        width: 100px;
        height: 100px;
        background-color: pink;
        transform: rotate(0deg);
        transition: 3s;
        margin: 100px auto;
        transform-origin: 0 0;
    }

    div:hover {
        transform: rotate(160deg);
    }
</style>
image.png
<style>
    div {
        width: 100px;
        height: 100px;
        background-color: pink;
        transform: skew(0deg);
        transition: 3s;
        margin: 100px auto;
        transform-origin: 0 0;
    }

    div:hover {
        transform: skewY(60deg);
    }
</style>
image.png
<style>
    div {
        width: 100px;
        height: 100px;
        background-color: pink;
        transform: scale(1);
        transition: 3s;
        margin: 100px auto;
    }

    div:hover {
        transform: scale(20);
    }
</style>
<style>
    div {
        width: 100px;
        height: 100px;
        background-color: pink;
        transform: translate(0);
        transition: 3s;
        margin: 100px auto;
    }

    div:hover {
        transform: translateY(200px);
    }
</style>
<style>
    div {
        width: 100px;
        height: 100px;
        background-color: pink;
        transition: 3s;
        margin: 100px auto;
    }
</style>
<body>
    <div id="box">

    </div>
    <script>
        window.onload = function () {
            var box = document.getElementById("box");
            box.onclick = function () {
                var a = 1,
                    b = 0,
                    c = 0,
                    d = 1,
                    e = 0,
                    f = 0;

                var deg = 60;

                a = Math.cos(deg / 180 * Math.PI);
                b = Math.sin(deg / 180 * Math.PI);
                c = -Math.sin(deg / 180 * Math.PI);
                d = Math.cos(deg / 180 * Math.PI);

                box.style.transform = "matrix(" + a + "," + b + "," + c + "," + d + "," + e + "," + f + ")"
                box.style.filter = "progid:DXImageTransform.Microsoft.Matrix( M11= " + a + ", M12= " + c + ", M21= " + b +
                    " , M22= " + d + ",SizingMethod='auto expand')";

            }

        }
    </script>
</body>
上一篇下一篇

猜你喜欢

热点阅读