首页 > Web开发 > 详细

css画小三角

时间:2016-09-23 12:59:11      阅读:195      评论:0      收藏:0      [点我收藏+]

要点:

  • div的宽度设为0
  • border-color 的transparent属性
<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8" />
    <title>Document</title>
    <style>
        .tri{
            margin: 60px;
            border: 10px solid ; 
            /*width: 0;  要有,不设置宽度的话,默认div的100%宽度,三角会跑到最右边*/
            /*border-color: red transparent transparent transparent;*/ 
            border-color:  transparent red transparent transparent;
            /*border-color:  transparent transparent red transparent;*/
            /*border-color:  transparent transparent transparent red;*/
            /*outline: 1px solid green;*/
        }
    </style>
</head>
<body>
    <div class="tri">
        
    </div>
</body>
</html>

 

css画小三角

原文:http://www.cnblogs.com/nostic/p/5899373.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!