css css编写三角形

来源:互联网 发布:c语言从1加到100while 编辑:程序博客网 时间:2024/05/18 03:29

三角的四个方向可修改,根据:border-top-color:;   border-bottom-color:;  border-left-color:;  border-right-color:;

<!DOCTYPE html><html lang="zh"><head>   <meta charset="UTF-8">   <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">    <meta name="viewport" content="width=device-width, initial-scale=1.0">   <title>三角形</title>   <style>      .icon-b {         display: inline-block;         width: 0px;         height: 0px;         border: 10px solid transparent;         border-top-color: #2fa0ec;         position: relative;         left: 3px;         top: 2px;      }   </style></head><body>   <b class="icon-b"></b></body></html>