您现在的位置:首页 >> 前端 >> 内容

css控制border画三角形

时间:2017/7/11 17:00:24 点击:

  核心提示:css控制border画三角形教程span style=font-size:18px;!DOCTYPE htmlhtmlheadmeta charset=utf-8titlecss控制border边框...

css控制border画三角形教程

<span style="font-size:18px;"><!DOCTYPE html>  
<html>  
<head>  
    <meta charset="utf-8">  
    <title>css控制border边框画三角形</title>  
    <style type="text/css">  
        p{  
            width: 50px;  
            background: red;  
        }  
        /*为了适应不同的背景 需要使边框透明  
        1.使用RGBA 颜色元素写为:rgba(200,200,200,0.5)  
        在RGB的基础上多了控制透明度的参数  
        根据需要填写最后一个数的值在 0~1之间即可  
        2.颜色为 transparent*/  
        #trip{  
            width: 0px;  
            height: 0px;  
            border-top: 50px solid transparent;  
            border-right: 50px solid rgba(200,200,200,0);  
            border-bottom: 50px solid yellow;  
            border-left: 50px solid rgba(200,200,200,0);  
        }  
    </style>  
</head>  
<body>  
    <p>  
        <p id="trip"></p>  
    </p>  
</body>  
</html></span>  
css控制border画三角形

为了适应不同的背景 需要使边框透明

1.使用RGBA 颜色元素写为:rgba(200,200,200,0.5)

在RGB的基础上多了控制透明度的参数

根据需要填写最后一个数的值在 0~1之间即可

2.颜色为 transparent

Tags:CS SS S控 控制 
作者:网络 来源:Winifred_1