<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Clip-Path Shapes with Background</title>
<link rel="stylesheet" href="/shapes.css">
</head>
<body>
<header>
<h1>Clip-Path Shapes with Background Images</h1>
<div class="clip-shapes">
<div class="shape shape1"></div>
<div class="shape shape2"></div>
<div class="shape shape3"></div>
<div class="shape shape4"></div>
<div class="shape shape5"></div>
<div class="shape shape6"></div>
<div class="shape shape7"></div>
<div class="shape shape8"></div>
<div class="shape shape9"></div>
<div class="shape shape10"></div>
</div>
</header>
</body>
</html>
body, html {
margin: 0;
padding: 0;
height: 100%;
display: flex;
justify-content: center;
align-items: center;
font-family: Arial, sans-serif;
background-color: #ffeb3b40;
}
header {
text-align: center;
}
header h1{
color: #e74816fa;
background-color: #222;
padding: 1rem;
border-radius: 8px;
-webkit-border-radius: 8px;
-moz-border-radius: 8px;
-ms-border-radius: 8px;
-o-border-radius: 8px;
}
.clip-shapes {
display: grid;
grid-template-columns: repeat(5, 1fr);
gap: 20px;
justify-items: center;
padding: 20px;
border: 1px solid red;
border-radius: 8px;
-webkit-border-radius: 8px;
-moz-border-radius: 8px;
-ms-border-radius: 8px;
-o-border-radius: 8px;
}
.shape {
width: 100px;
height: 100px;
background-image: url('https://picsum.photos/200');
background-size: cover;
background-position: center;
}
.shape1 {
clip-path: circle(50%);
}
.shape2 {
clip-path: ellipse(50% 25%);
}
.shape3 {
clip-path: polygon(50% 0%, 100% 100%, 0% 100%);
}
.shape4 {
clip-path: polygon(0% 0%, 100% 0%, 100% 100%, 0% 100%, 50% 50%);
}
.shape5 {
clip-path: polygon(50% 0%, 100% 50%, 50% 100%, 0% 50%);
}
.shape6 {
clip-path: polygon(0 0, 100% 0, 100% 50%, 50% 100%, 0 50%);
}
.shape7 {
clip-path: polygon(25% 0%, 75% 0%, 100% 50%, 75% 100%, 25% 100%, 0% 50%);
}
.shape8 {
clip-path: polygon(50% 0%, 85% 20%, 100% 50%, 85% 80%, 50% 100%, 15% 80%, 0% 50%, 15% 20%);
}
.shape9 {
clip-path: polygon(20% 0%, 80% 0%, 100% 20%, 100% 80%, 80% 100%, 20% 100%, 0% 80%, 0% 20%);
}
.shape10 {
clip-path: polygon(0% 0%, 100% 0%, 75% 100%, 25% 100%);
}