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

css实现等边六边形

 

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

css实现等边六边形

 

具体的html代码如下:

<!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>

  

 

相关文章:

  • 2021-12-19
  • 2022-01-14
  • 2021-11-17
  • 2021-04-28
  • 2021-07-06
  • 2022-12-23
  • 2022-12-23
  • 2022-02-27
猜你喜欢
  • 2022-12-23
  • 2021-06-05
  • 2022-12-23
  • 2022-02-13
  • 2022-12-23
  • 2021-09-25
  • 2021-10-09
相关资源
相似解决方案