CSS各个方向的三角形代码
分类:实例代码
很多网页效果都用到三角形,可以利用图片实现,也可以使用CSS实现。
下面就分享一段代码实例,它实现了各个方向的三角形效果。
代码实例如下:
<!DOCTYPE html> <html> <head> <meta charset=" utf-8"> <meta name="author" content="http://www.pipipi.net/" /> <title>前端教程网</title> <style type="text/css"> .rightdirection{ width:0; height:0; line-height:0; border-width:20px; border-style:solid; border-color:transparent transparent transparent #A9DBF6; } .bottomdirection{ width:0; height:0; line-height:0; border-width:20px; border-style:solid; border-color: #A9DBF6 transparent transparent transparent; } .leftdirection{ width:0; height:0; line-height:0; border-width:20px; border-style:solid; border-color: transparent #A9DBF6 transparent transparent; } .topdirection{ width:0; height:0; line-height:0; border-width:20px; border-style:solid; border-color: transparent transparent #A9DBF6 transparent; } </style> </head> <body> <div class="rightdirection"></div> <div class="bottomdirection"></div> <div class="leftdirection"></div> <div class="topdirection"></div> </body> </html>
CSS各个方向的三角形代码,这样的场景在实际项目中还是用的比较多的,关于CSS各个方向的三角形代码就介绍到这了。
CSS各个方向的三角形代码属于前端实例代码,有关更多实例代码大家可以查看。