본문 바로가기
Coding/HTML & CSS

[HTML & CSS] 이미지 호버(image hover) 하는 방법 !!!

by 포스트it 2020. 10. 10.
728x90
반응형

코드부터 바로 보여드릴께요 !!

<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>image hover</title>
<style>
    img:hover {
    width:400px;
    transform:scale(1.5);
    transition: transform.5s;
    }
</style>
</head>
<body>
    <img src="https://pbs.twimg.com/media/D0AEcLJVYAErhXl?format=jpg&amp;name=medium" width=400px; alt="아이유사진">
</body>
</html>

 

아이유사진
img:hover {
    width:400px;  /* 사진크기 조절 */
    transform:scale(2, 1.5);  /* 가로2배 새로 1.5배 로 커짐 */
    transition: transform.5s;  /* 커지는 시간 */
}

 

 

728x90
반응형

댓글