프런트엔드-CSS

CSS 스타일링

강사: 최퍼블리셔 · 작성자: 이종춘 · 작성일: 2026-04-27 18:23:35 · 조회수: 8

스타일시트 트랜지션 문제1 설명
목록으로
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Document</title>
<style>

*{
margin: 0;
padding: 0;
box-sizing: border-box;
}

.wrap{
width: 500px;
height: 500px;
margin: 100px auto;
position: relative;
display: flex;
align-items: center;
font-size: 50px;
justify-content: center;
background-color: lightgray;
}

.wrap h2{
opacity: 0;
transition: 1s;
}

.line{
position: absolute;
background-color: black;
transition: 1s;
}

.top{
width: 0%;
height: 10px;
top: 0;
left: 0;
}

.right{
width:10px;
height: 0%;
top: 0;
right: 0;
}

.bottom{
width: 0%;
height: 10px;
bottom: 0;
right: 0;
}

.left{
width:10px;
height: 0%;
bottom: 0;
left: 0;
}

.wrap:hover .top{
width: 100%;
}

.wrap:hover .right{
height: 100%;
transition-delay: 1s;
}

.wrap:hover .bottom{
width: 100%;
transition-delay: 2s;
}

.wrap:hover .left{
height: 100%;
transition-delay: 3s;
}

.wrap:hover h2{
opacity: 1;
transition-delay: 4s;
}


</style>
</head>
<body>

<div class="wrap">
<div class="line top"></div>
<div class="line right"></div>
<div class="line bottom"></div>
<div class="line left"></div>
<h2>Title</h2>
</div>

</body>
</html>
#스타일시트 트랜지션 문제1

첨부 파일

0개
첨부된 파일이 없습니다.

댓글 / 답글

0개
댓글을 작성하려면 로그인하세요.
아직 댓글이 없습니다.