我一直在擺弄CSS clip-path屬性,并創造性地設計按鈕元素的樣式。我的HTML和CSS如下:
body {
text-align: center;
padding: 80px;
}
button {
width: 400px;
height: 280px;
background-color: red;
color: white;
font-size: 40px;
font-family: "Open Sans", sans-serif;
font-weight: 700;
border: 0;
/* box-shadow: 0 10px 30px 0px rgba(0, 0, 0, 0.75); */
clip-path: polygon(0 0, 50% 15%, 100% 0, 100% 100%, 50% 85%, 0 100%);
transition: 0.55s;
padding-right: 220px;
}
button:hover {
clip-path: polygon(0 15%, 49% 0, 49% 50%, 51% 50%, 51% 0, 100% 15%, 100% 85%, 51% 100%, 51% 50%, 49% 50%, 49% 100%, 0 85%);
background-color: #bb0000;
transform: rotateZ(360deg);
padding-right: initial;
padding-left: 220px;
}
<button>Contact<br>Us</button>