HTML, CSS

(69)CSS_transition1

빠스무 2023. 4. 4. 15:40
728x90
 

(66)CSS_기본문법

trangsfrom 2차원 좌표에서 요소를 변형시키는 속성 tramslate : 이동 rotate : 회원 scale : 확대, 축소 skew : 경사, 비틀기 ✔ 벤터 프리픽스(vender prefix) 주요 웹 브라우저 공급자가 새로운 실험적인 기능을

jm-rograming.tistory.com

<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>transition</title>
    <style>
        div{
            width: 100px;
            height: 100px;
            float: left;
            margin: 30px;
        }
        #bg-tr{
            background-color: gold;
            transition: background-color ease 2s;
        }
        #bg-tr:hover{
            background-color: red;
        }
        #border-tr{
            background-color: deeppink;
            border: 3px dotted black;
            transition: all linear 2s;
        }
        #border-tr:hover{
            background-color: pink;
            border: 3px dotted gray;
            border-radius: 50%;
        }
    </style>
</head>
<body>
    <h2>transition</h2>
    <div id="bg-tr"></div>
    <div id="border-tr"></div>
</body>
</html>

  • 왼쪽이 마우스 커서를 올려놨을때의 경우로 설정한 값으로 변하는 것을 볼 수 있다.