CSS3如何写一个六边形图形代码

CSS3如何写一个六边形图形代码:

html:

<div class="sharp"><div class="sharpb"><b>01</b></div></div>

css:

.sharp {background-color: #999; width: 134px;
    height: 151px; padding: 5px;
    webkit-clip-path: polygon(50% 0, 100% 25%, 100% 75%, 50% 100%, 0 75%, 0 25%);
    clip-path: polygon(50% 0, 100% 25%, 100% 75%, 50% 100%, 0 75%, 0 25%);
     }
.sharpb {background-color: #fff; width: 134px; height: 151px; line-height: 151px; text-align: center;
    webkit-clip-path: polygon(50% 0, 100% 25%, 100% 75%, 50% 100%, 0 75%, 0 25%);
    clip-path: polygon(50% 0, 100% 25%, 100% 75%, 50% 100%, 0 75%, 0 25%);}
 .sharp b {color: #333; font-size: 40px;}
 .sharp:hover {background-color: #36ABB4;}
 .sharp:hover b {color: #36ABB4;}

 

共享资源网提供最优质的资源集合。
共享资源网 » CSS3如何写一个六边形图形代码

发表评论

共享资源网提供最优质的资源集合

充值中心 开启会员