WD1X.COM - 问答一下,轻松解决,电脑应用解决专家
主板显卡CPU内存显示器
硬盘维修显卡维修显示器维修
注册表系统命令DOS命令Win8
存储光存储鼠标键盘
内存维修打印机维修
WinXPWin7Win11Linux
硬件综合机箱电源散热器手机数码
主板维修CPU维修键盘鼠标维修
Word教程Excel教程PowerPointWPS
网络工具系统工具图像工具
数据库javascript服务器
PHP教程CSS教程XML教程

css实现等边六边形

更新时间:2021-04-11 15:09 作者:一只看夕阳的猫点击:

在平时的页面布局中,我们也会经常碰到蜂窝煤类型的模块:

 

那么我们把他拆开,就是单个的六边形,如何用css去实现一个六边形呢?下面是我用绘图软件绘制的css实现六边形的步骤:

 

具体的html代码如下:

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
<!DOCTYPE html>
<html>
    <head>
    <meta charset="UTF-8">
    <title></title>
    <style type="text/css">
      .list{
        width: 200px;
        height: 250px;
        overflow: hidden;
        transform: rotate(120deg);
        margin: 200px;
      }
      .list_child{
        width: 100%;
        height: 100%;
        overflow: hidden;
        transform: rotate(-60deg);
      }
      .list_child_child{
        width: 100%;
        height: 100%;
        overflow: hidden;
        transform: rotate(-60deg);
        background-color: red;
      }
    </style>
  </head>
  <body>
    <div class="list">
      <div class="list_child">
        <div class="list_child_child"></div>
      </div>
    </div>
  </body>
</html>

顶一下
(0)
0%
踩一下
(0)
0%
------分隔线----------------------------
你可能感兴趣的内容