css
11장 예제 - 트랜지션 대상과 진행 시간 진행하기
쥬크버그
2023. 4. 3. 19:46
<!DOCTYPE html>
<html lang="ko">
<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> 트랜지션 대상과 진행 시간 지정하기 </title>
<style>
.box {
margin:20px auto;
width:100px;
height:100px;
background-color:#07f;
border: 1px solid black;
transition-property: width,height; /*트랜지션 대상 - 너비, 높이*/
transition-duration:2s, 1s; /*트랜지션 시간 -2초 1초*/
}
.box:hover {
width:200px;
height:120px;
}
</style>
</head>
<body>
<div class="box"></div>
</body>
</html>