<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>css控制border边框画三角形</title>
<style type="text/css">
div{
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>
<div>
<div id="trip"></div>
</div>
</body>
</html>
为了适应不同的背景 需要使边框透明
1.使用RGBA 颜色元素写为:rgba(200,200,200,0.5)
在RGB的基础上多了控制透明度的参数
根据需要填写最后一个数的值在 0~1之间即可
2.颜色为 transparent