css实现三角形

 1 <!DOCTYPE html>
 2 <html lang="en">
 3 
 4 <head>
 5     <meta charset="UTF-8">
 6     <meta name="viewport" content="width=device-width, initial-scale=1.0">
 7     <meta http-equiv="X-UA-Compatible" content="ie=edge">
 8     <meta name="author" content="杨欣">
 9     <title>css三角形</title>
10     <style>
11         .triangle{
12             width: 0;
13             height: 0;
14             border-width: 40px;
15             border-style: solid;
16             border-color: transparent transparent transparent red;
17             /*border-color的四个值代表上右下左,分别实现下左上右箭头 */
18         }
19     </style>
20 </head>
21 
22 <body>
23 <div class="triangle"></div>
24 </body>
25 
26 </html>

 

posted @ 2019-03-12 09:47  Samsara315  阅读(2011)  评论(0编辑  收藏  举报