# 其他多边形

背景知识: box-sizing (opens new window), transform (opens new window) *{ box-sizing: border-box; }

<style>
  .main-polygon {
    width: 100%;
    padding: 60px 0;
    display: flex;
    justify-content: center;
    align-items: center;
    flex-wrap: wrap;
  }
  .main-polygon > div.item {
    min-width: 199px; height: 200px;
    padding: 20px;
    border: 1px solid #f5f5f5;
    flex: 1;
    display: flex;
    justify-content: center;
    align-items: center;
  }
  .main-polygon > div.item:not(:nth-child(3n)):not(:last-child) {
    border-right-width:0;
  }
  .main-polygon .item > div {
    box-sizing: content-box;
  }
  .trapezoid {
    width: 80px; height: 0;
    border: 40px solid #fff;
    border-top: 0 solid;
    border-bottom: 80px solid #b4a078;
  }
  .star-5-points {
    width: 0; height: 0;
    position: relative;
    margin: 50px 0;
    border: 80px solid rgba(0,0,0,0);
    border-top: 0 solid;
    border-bottom: 56px solid #b4a078;
    transform: rotateZ(35deg);
  }
  .star-5-points::before {
    content: "";
    width: 0; height: 0;
    position: absolute;
    top: -36px; left: -52px;
    border: 24px solid rgba(0,0,0,0);
    border-top: 0 solid;
    border-bottom: 64px solid #b4a078;
    transform: rotateZ(-35deg);
  }
  .star-5-points::after {
    content: "";
    width: 0; height: 0;
    position: absolute;
    top: 3px; left: -86px;
    border: 80px solid rgba(0,0,0,0);
    border-top: 0 solid;
    border-bottom: 56px solid #b4a078;
    transform: rotateZ(-70deg);
  }
  .ribbon {
    width: 0; height: 80px;
    border: 40px solid #b4a078;
    border-top: 0 solid;
    border-bottom: 28px solid rgba(0,0,0,0);
  }
  .diamond {
    width: 50px; height: 0;
    position: relative;
    margin: 20px 0 82px;
    border: 25px solid rgba(0,0,0,0);
    border-top-width: 0;
    border-bottom-color: #b4a078;
  }
  .diamond::after {
    content: "";
    width: 0; height: 0;
    position: absolute;
    top: 25px; left: -25px;
    border: 50px solid rgba(0,0,0,0);
    border-top: 70px solid #b4a078;
    border-bottom-width: 0;
  }
  .heart {
    content: "";
    display: block;
    width: 100px;
    min-height: 80px;
    position: relative;
    transform-origin: 50% 50% 0;
  }
  .heart:before {
    content: "";
    display: block;
    width: 50px; height: 80px;
    position: absolute;
    top: 0; left: 50px;
    border-radius: 50px 50px 0 0;
    background: #b4a078;
    transform: rotateZ(-45deg);
    transform-origin: 0 100% 0;
  }
  .heart:after {
    content: "";
    display: block;
    width: 50px; height: 80px;
    position: absolute;
    top: 0; left: 0;
    border-radius: 50px 50px 0 0;
    background: #b4a078;
    transform: rotateZ(45deg);
    transform-origin: 100% 100% 0;
  }
  .army-chevron {
    width: 200px; height: 60px;
    position: relative;
    margin: 0 0 6px;
    padding: 12px;
    text-align: center;
  }
  .army-chevron::before {
    content: "";
    width: 51%; height: 100%;
    position: absolute;
    top: 0; left: 0;
    background: #b4a078;
    transform: skewY(6deg);
  }
  .army-chevron::after {
    content: "";
    width: 50%; height: 100%;
    position: absolute;
    top: 0; right: 0;
    background: #b4a078;
    transform: skewY(-6deg);
  }
</style>
<template>
  <div class="main-polygon">
    <div class="item"><div class="trapezoid"></div></div>
    <div class="item"><div class="star-5-points"></div></div>
    <div class="item"><div class="ribbon"></div></div>
    <div class="item"><div class="diamond"></div></div>
    <div class="item"><div class="heart"></div></div>
    <div class="item"><div class="army-chevron"></div></div>
  </div>
</template>
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
显示代码 复制代码
上次更新: 2023-10-28