tomyan112
Pipeline Operator
2
MONTHS
2 2 MONTHS OF SERVICE
LEVEL 2
1000 XP




Step 1: Set Up Your HTML Structure
Code:
Code:
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Sliced Image Hover Effect</title>
</head>
Code:
Code:
body {
margin: 0;
display: flex;
align-items: center;
justify-content: center;
height: 100vh;
}
.image-container {
position: relative;
overflow: hidden;
}
img {
display: block;
width: 100%;
height: auto;
}
.slice {
position: absolute;
background: #000; /* Adjust the background color as needed */
transition: all 0.3s ease-in-out;
pointer-events: none; /* Allows mouse events to pass through the slices */
}
/* Customize the slice sizes and positions */
.slice:nth-child(1) { top: 0; left: 0; width: 50%; height: 50%; }
/* Add more styles for additional slices */
Code:
Code:
.slice:hover {
width: 0;
height: 0;
}