使用div元素制作一个三角形:
<!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <meta name="viewport" content="width=device-width, initial-scale=1.0"> <title>Document</title> <!-- reset.css文件内容参考:https://www.cnblogs.com/lanshanxiao/p/12663192.html --> <link rel="stylesheet" href="./reset.css"> <style> div{ width:0; height:0; border:20px solid transparent; border-right-color: #000; } </style> </head> <body> <div> </div> </body> </html>
效果展示: