개발

[CSS3] transition

지승준 2015. 7. 6. 00:04
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
<!DOCTYPE html>
<html lang="ko">
    <head>
        <meta charset="utf-8" />
        <title>transition</title>
        <style>
            
            .wrap {
                width:238px; 
                height:199px;
                border:5px solid #000;
                cursor:pointer; 
                position: fixed;
                left:50%;
                top:50%;
                margin:-99.5px 0 0 -119px;
                overflow: hidden;
            }
            
            .box {
                position: absolute;
                top:0px;
                /*
                transition이란 
                css의 숫자값의 변화를
                부드럽게 처리하는 속성
                */
                transition:.3s cubic-bezier(.66,.12,.48,1.6) .1s;
            }
            .wrap:hover>.box {
                top:-200px;
            }
            .box img {
                display: block;
            }
 
            
       </style>
    </head>
    <body>
        <div class="wrap">
            <div class="box">
                <img src="img/500px.png" alt=""/>
                <img src="img/500px_hover.png" alt=""/>
            </div>
        </div>
    </body>
</html>
cs


'개발' 카테고리의 다른 글

[javascript] 셀병합, rowspan  (0) 2015.07.22
[javascript] 페이지 이동  (0) 2015.07.22
[php] 문자열 자르기  (0) 2015.07.04
[아두이노] 소프트웨어 설치 및 LED 깜빡이기  (0) 2015.06.30
[Swift] Stift Webview  (0) 2015.06.30