欢迎光临
我们一直在努力

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;}

 

赞(0) 打赏
未经允许不得转载:新起点博客 » CSS3如何写一个六边形图形代码


关注公众号『新起点软件管家』

获取最新网络资源及破解软件!
带你玩转各样软件...

评论 抢沙发

评论前必须登录!

 

觉得文章有用就打赏一下文章作者

非常感谢你的打赏,我们将继续给力更多优质内容,让我们一起创建更加美好的网络世界!

支付宝扫一扫打赏

微信扫一扫打赏