📜  格式化六边形 css 获取 - CSS 代码示例

📅  最后修改于: 2022-03-11 14:47:55.003000             🧑  作者: Mango

代码示例1
.hexagon {
  position: relative;
  width: 300px; 
  height: 173.21px;
  background-color: #eb0f5c;
  margin: 86.60px 0;
}

.hexagon:before,
.hexagon:after {
  content: "@";
  position: absolute;
  width: 0;
  border-left: 150px solid transparent;
  border-right: 150px solid transparent;
}

.hexagon:before {
  bottom: 100%;
  border-bottom: 86.60px solid #eb0f5c;
}

.hexagon:after {
  top: 100%;
  width: 0;
  border-top: 86.60px solid #eb0f5c;
}