css梯形代码实例
分类:实例代码
css梯形代码实例属于前端实例代码,有关更多实例代码大家可以查看。
下面是使用css绘制一个梯形的代码实例,需要的朋友可以做一下参考。
代码实例如下:
<!doctype html> <html> <head> <meta charset="utf-8"> <meta name="author" content="http://www.pipipi.net/" /> <title>前端教程网</title> <style type="text/css"> .box { width: 200px; height: 200px; padding: 10px; margin: 10px 20px; } .tab { position: relative; padding: .5em 1em .35em; color: white; } .tab::before { content: ""; position: absolute; top: 0; right: 0; bottom: 0; left: 0; z-index: -1; background: #58a; transform: perspective(.5em) rotateX(5deg); transform-origin: bottom; } </style> </head> <body> <div class="box tab">梯形</div> </body> </html>
css梯形代码实例,这样的场景在实际项目中还是用的比较多的,关于css梯形代码实例就介绍到这了。