以下是用css3画3角形,效果如下图
<!doctype html> <html> <head> <meta charset="utf-8"> <title>无标题文档</title> <style> span{ display:inline-block; margin-right:10px} .triangle_top{height:0;width:0; border:10px solid; border-color:transparent transparent red transparent;} .triangle_left{height:0;width:0; border:10px solid; border-color:transparent red transparent transparent;} .triangle_right{height:0;width:0; border:10px solid; border-color:transparent transparent transparent red;} .triangle_bottom{height:0;width:0; border:10px solid; border-color:red transparent transparent transparent;} </style> </head> <body> <span class="triangle_top"></span> <span class="triangle_left"></span> <span class="triangle_right"></span> <span class="triangle_bottom"></span> </body> </html>
时间: 2024-10-05 18:08:26