Add files via upload
This commit is contained in:
parent
f04ebfbc91
commit
ed3d812909
BIN
23-clip-path-image-hover-effects/img/01.jpg
Normal file
BIN
23-clip-path-image-hover-effects/img/01.jpg
Normal file
Binary file not shown.
After Width: | Height: | Size: 86 KiB |
BIN
23-clip-path-image-hover-effects/img/02.jpg
Normal file
BIN
23-clip-path-image-hover-effects/img/02.jpg
Normal file
Binary file not shown.
After Width: | Height: | Size: 75 KiB |
16
23-clip-path-image-hover-effects/index.html
Normal file
16
23-clip-path-image-hover-effects/index.html
Normal file
@ -0,0 +1,16 @@
|
|||||||
|
<!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">
|
||||||
|
<link rel="stylesheet" href="style.css">
|
||||||
|
<title>Document</title>
|
||||||
|
</head>
|
||||||
|
<body>
|
||||||
|
<div class="container">
|
||||||
|
<div class="box"></div>
|
||||||
|
<div class="box"></div>
|
||||||
|
</div>
|
||||||
|
</body>
|
||||||
|
</html>
|
40
23-clip-path-image-hover-effects/style.css
Normal file
40
23-clip-path-image-hover-effects/style.css
Normal file
@ -0,0 +1,40 @@
|
|||||||
|
*{
|
||||||
|
margin:0;
|
||||||
|
padding:0;
|
||||||
|
box-sizing: border-box;
|
||||||
|
}
|
||||||
|
body{
|
||||||
|
display: flex;
|
||||||
|
justify-content: center;
|
||||||
|
align-items: center;
|
||||||
|
min-height: 100vh;
|
||||||
|
background: #111;
|
||||||
|
}
|
||||||
|
.container{
|
||||||
|
position: relative;
|
||||||
|
width:550px;
|
||||||
|
height: 400px;
|
||||||
|
border: 4px solid #fff;
|
||||||
|
}
|
||||||
|
.container .box{
|
||||||
|
position: absolute;
|
||||||
|
width: 100%;
|
||||||
|
height: 100%;
|
||||||
|
|
||||||
|
}
|
||||||
|
.container .box:nth-child(1){
|
||||||
|
background: url(img/01.jpg);
|
||||||
|
transition: .5s;
|
||||||
|
}
|
||||||
|
.container .box:nth-child(2){
|
||||||
|
background: url(img/02.jpg);
|
||||||
|
z-index: 2;
|
||||||
|
transition: .5s;
|
||||||
|
clip-path: polygon(0 0, 100% 0, 100% 0%, 0% 100%);
|
||||||
|
}
|
||||||
|
.container .box:nth-child(2):hover{
|
||||||
|
clip-path: polygon(0 0, 100% 0, 100% 100%, 0% 100%);
|
||||||
|
}
|
||||||
|
.container .box:nth-child(1):hover ~ .box:nth-child(2){
|
||||||
|
clip-path: polygon(0 0, 100% 0, 100% 0, 0 0);
|
||||||
|
}
|
Loading…
Reference in New Issue
Block a user