如图,正常的气泡,三角不管是用传统方法实现还是,css都表容易实现,但是这个三角效果,怎么才能实现呢,求教如果用canvas画图的话,有点浪费,纯css3是否有实现方案呢我的思路是方形旋转45°,两边不透明
简单的一个思路,可以参考一下: <!DOCTYPE html> <html lang="zh-cn"> <head> <meta charset="UTF-8"> <title>Document</title> <style> .a { margin: 100px auto; width: 200px; position: relative; border-bottom: 1px solid #333; } .a:after { position: absolute; top: -5px; left: 50%; margin-left: -5px; content: ''; transform: rotate(45deg); border-top: 1px solid #333; border-left: 1px solid #333; height: 10px; width: 10px; background: #fff; } </style> </head> <body> <div class="a"></div> </body> </html> 效果图:
简单的一个思路,可以参考一下:
效果图:
