<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Polygons </title>
<link rel="stylesheet" href="/polygon.css">
</head>
<body>
<header>
<div class="polygon left"></div>
<div class="polygon right"></div>
<h1>Polygons Shapes</h1>
</header>
</body>
</html>
body, html {
margin: 0;
padding: 0;
height: 100%;
}
header {
position: relative;
background-color: #e91e6352;
height: 200px;
display: flex;
align-items: center;
justify-content: center;
color: #222;
font-family: Arial, sans-serif;
text-align: center;
}
.polygon {
position: absolute;
width: 800px;
height: 100px;
background-image: url('https://codezillaye.com/wp-content/uploads/2024/06/tailwind-css.256x154.png');
/* clip-path: polygon(50% 0%, 100% 100%, 0% 100%); */
clip-path: polygon(50% 100%, 83% 12%, 13% 31%, 100% 97%, 50% 100%, 79% 16%, 0 88%, 87% 7%, 0 6%);
}
.polygon.left {
left: 10%;
top: 50%;
transform: translate(-50%, -50%);
-webkit-transform: translate(-50%, -50%);
-moz-transform: translate(-50%, -50%);
-ms-transform: translate(-50%, -50%);
-o-transform: translate(-50%, -50%);
}
.polygon.right {
right: 20%;
top: 50%;
transform: translate(50%, -50%);
}