赞
踩
分享一段代码实例,它实现了六角形效果。
代码实例如下:
<!doctype html> <html> <head> <meta charset="utf-8"> <meta name="author" content="[网页链接](http://www.softwhy.com/%22) /> <title>蚂蚁部落</title> <style type="text/css"> #six { width: 0; height: 0; border-left: 60px solid transparent; border-right: 60px solid transparent; border-bottom: 120px solid red; position: relative; } #six:after { content: ""; width: 0; height: 0; border-left: 60px solid transparent; border-right: 60px solid transparent; border-top: 120px solid red; position: absolute; top: 40px; left: -60px; } .six { position: absolute; top: 50%; left: 50%; transform: translate(-50%,-50%); } </style> </head> <body> <div class="six"> <div id="six"></div> </div> </body> &l
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。